Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
a710fbf6
Kaydet (Commit)
a710fbf6
authored
Şub 01, 2016
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Unit test for Client.update_container method
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
6f6d0890
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
container_test.py
tests/unit/container_test.py
+18
-0
fake_api.py
tests/unit/fake_api.py
+7
-0
No files found.
tests/unit/container_test.py
Dosyayı görüntüle @
a710fbf6
...
...
@@ -1407,3 +1407,21 @@ class ContainerTest(DockerClientTest):
params
=
{
'ps_args'
:
'waux'
},
timeout
=
DEFAULT_TIMEOUT_SECONDS
)
@requires_api_version
(
'1.22'
)
def
test_container_update
(
self
):
self
.
client
.
update_container
(
fake_api
.
FAKE_CONTAINER_ID
,
mem_limit
=
'2k'
,
cpu_shares
=
124
,
blkio_weight
=
345
)
args
=
fake_request
.
call_args
self
.
assertEqual
(
args
[
0
][
1
],
url_prefix
+
'containers/3cc2351ab11b/update'
)
self
.
assertEqual
(
json
.
loads
(
args
[
1
][
'data'
]),
{
'Memory'
:
2
*
1024
,
'CpuShares'
:
124
,
'BlkioWeight'
:
345
}
)
self
.
assertEqual
(
args
[
1
][
'headers'
][
'Content-Type'
],
'application/json'
)
tests/unit/fake_api.py
Dosyayı görüntüle @
a710fbf6
...
...
@@ -441,6 +441,11 @@ def get_fake_volume():
def
fake_remove_volume
():
return
204
,
None
def
post_fake_update_container
():
return
200
,
{
'Warnings'
:
[]}
# Maps real api url to fake response callback
prefix
=
'http+docker://localunixsocket'
fake_responses
=
{
...
...
@@ -478,6 +483,8 @@ fake_responses = {
get_fake_diff
,
'{1}/{0}/containers/3cc2351ab11b/export'
.
format
(
CURRENT_VERSION
,
prefix
):
get_fake_export
,
'{1}/{0}/containers/3cc2351ab11b/update'
.
format
(
CURRENT_VERSION
,
prefix
):
post_fake_update_container
,
'{1}/{0}/containers/3cc2351ab11b/exec'
.
format
(
CURRENT_VERSION
,
prefix
):
post_fake_exec_create
,
'{1}/{0}/exec/d5d177f121dc/start'
.
format
(
CURRENT_VERSION
,
prefix
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment