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
f6b816c2
Kaydet (Commit)
f6b816c2
authored
Nis 28, 2015
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix #573
üst
aceb7a69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
decorators.py
docker/utils/decorators.py
+9
-6
test.py
tests/test.py
+8
-2
No files found.
docker/utils/decorators.py
Dosyayı görüntüle @
f6b816c2
...
@@ -3,11 +3,14 @@ from .. import errors
...
@@ -3,11 +3,14 @@ from .. import errors
def
check_resource
(
f
):
def
check_resource
(
f
):
def
wrapped
(
self
,
resource_id
=
None
,
*
args
,
**
kwargs
):
def
wrapped
(
self
,
resource_id
=
None
,
*
args
,
**
kwargs
):
if
resource_id
is
None
and
(
if
resource_id
is
None
:
kwargs
.
get
(
'container'
)
is
None
and
kwargs
.
get
(
'image'
)
is
None
if
kwargs
.
get
(
'container'
):
):
resource_id
=
kwargs
.
pop
(
'container'
)
raise
errors
.
NullResource
(
elif
kwargs
.
get
(
'image'
):
'image or container param is None'
resource_id
=
kwargs
.
pop
(
'image'
)
)
else
:
raise
errors
.
NullResource
(
'image or container param is undefined'
)
return
f
(
self
,
resource_id
,
*
args
,
**
kwargs
)
return
f
(
self
,
resource_id
,
*
args
,
**
kwargs
)
return
wrapped
return
wrapped
tests/test.py
Dosyayı görüntüle @
f6b816c2
...
@@ -675,17 +675,23 @@ class DockerClientTest(Cleanup, base.BaseTestCase):
...
@@ -675,17 +675,23 @@ class DockerClientTest(Cleanup, base.BaseTestCase):
try
:
try
:
self
.
client
.
start
(
container
=
None
)
self
.
client
.
start
(
container
=
None
)
except
ValueError
as
e
:
except
ValueError
as
e
:
self
.
assertEqual
(
str
(
e
),
'image or container param is
None
'
)
self
.
assertEqual
(
str
(
e
),
'image or container param is
undefined
'
)
else
:
else
:
self
.
fail
(
'Command should raise ValueError'
)
self
.
fail
(
'Command should raise ValueError'
)
try
:
try
:
self
.
client
.
start
(
None
)
self
.
client
.
start
(
None
)
except
ValueError
as
e
:
except
ValueError
as
e
:
self
.
assertEqual
(
str
(
e
),
'image or container param is
None
'
)
self
.
assertEqual
(
str
(
e
),
'image or container param is
undefined
'
)
else
:
else
:
self
.
fail
(
'Command should raise ValueError'
)
self
.
fail
(
'Command should raise ValueError'
)
def
test_start_container_regression_573
(
self
):
try
:
self
.
client
.
start
(
**
{
'container'
:
fake_api
.
FAKE_CONTAINER_ID
})
except
Exception
as
e
:
self
.
fail
(
'Command should not raise exception: {0}'
.
format
(
e
))
def
test_create_container_with_lxc_conf
(
self
):
def
test_create_container_with_lxc_conf
(
self
):
try
:
try
:
self
.
client
.
create_container
(
self
.
client
.
create_container
(
...
...
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