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
1f8cde85
Kaydet (Commit)
1f8cde85
authored
Ock 09, 2015
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Integration tests fixes
üst
43c33465
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
35 deletions
+15
-35
integration_test.py
tests/integration_test.py
+15
-35
No files found.
tests/integration_test.py
Dosyayı görüntüle @
1f8cde85
...
...
@@ -907,17 +907,20 @@ class TestStartContainerWithLinks(BaseTestCase):
class
TestRestartingContainer
(
BaseTestCase
):
def
runTest
(
self
):
container
=
self
.
client
.
create_container
(
'busybox'
,
[
'
false
'
],
host_config
=
create_host_config
(
restart_policy
=
{
"Name"
:
"
on-failure"
,
"MaximumRetryCount"
:
1
}
'busybox'
,
[
'
sleep'
,
'2
'
],
host_config
=
create_host_config
(
restart_policy
=
{
"Name"
:
"
always"
,
"MaximumRetryCount"
:
0
}
)
)
id
=
container
[
'Id'
]
self
.
client
.
start
(
id
)
self
.
client
.
wait
(
id
)
self
.
client
.
remove_container
(
id
)
containers
=
self
.
client
.
containers
(
all
=
True
)
res
=
[
x
for
x
in
containers
if
'Id'
in
x
and
x
[
'Id'
]
.
startswith
(
id
)]
self
.
assertEqual
(
len
(
res
),
0
)
with
self
.
assertRaises
(
docker
.
errors
.
APIError
)
as
exc
:
self
.
client
.
remove_container
(
id
)
err
=
exc
.
exception
.
response
.
text
self
.
assertTrue
(
err
.
startswith
(
'You cannot remove a running container'
)
)
self
.
client
.
remove_container
(
id
,
force
=
True
)
class
TestExecuteCommand
(
BaseTestCase
):
...
...
@@ -1121,7 +1124,7 @@ class TestRemoveImage(BaseTestCase):
self
.
assertIn
(
'Id'
,
res
)
img_id
=
res
[
'Id'
]
self
.
tmp_imgs
.
append
(
img_id
)
self
.
client
.
remove_image
(
img_id
)
self
.
client
.
remove_image
(
img_id
,
force
=
True
)
images
=
self
.
client
.
images
(
all
=
True
)
res
=
[
x
for
x
in
images
if
x
[
'Id'
]
.
startswith
(
img_id
)]
self
.
assertEqual
(
len
(
res
),
0
)
...
...
@@ -1203,32 +1206,6 @@ class TestBuildFromStringIO(BaseTestCase):
self
.
assertNotEqual
(
logs
,
''
)
class
TestBuildWithAuth
(
BaseTestCase
):
def
runTest
(
self
):
if
compare_version
(
self
.
client
.
_version
,
'1.9'
)
>=
0
:
return
k
=
'K4104GON3P4Q6ZUJFZRRC2ZQTBJ5YT0UMZD7TGT7ZVIR8Y05FAH2TJQI6Y90SMIB'
self
.
client
.
login
(
'quay+fortesting'
,
k
,
registry
=
'https://quay.io/v1/'
,
email
=
''
)
script
=
io
.
BytesIO
(
'
\n
'
.
join
([
'FROM quay.io/quay/teststuff'
,
'MAINTAINER docker-py'
,
'RUN mkdir -p /tmp/test'
,
])
.
encode
(
'ascii'
))
stream
=
self
.
client
.
build
(
fileobj
=
script
,
stream
=
True
)
logs
=
''
for
chunk
in
stream
:
if
six
.
PY3
:
chunk
=
chunk
.
decode
(
'utf-8'
)
logs
+=
chunk
self
.
assertNotEqual
(
logs
,
''
)
self
.
assertEqual
(
logs
.
find
(
'HTTP code: 403'
),
-
1
)
class
TestBuildWithDockerignore
(
Cleanup
,
BaseTestCase
):
def
runTest
(
self
):
if
compare_version
(
self
.
client
.
_version
,
'1.8'
)
>=
0
:
...
...
@@ -1384,9 +1361,12 @@ class TestRegressions(unittest.TestCase):
self
.
client
=
docker
.
client
.
Client
(
timeout
=
5
)
def
test_443
(
self
):
dfile
=
io
.
BytesIO
()
with
self
.
assertRaises
(
docker
.
errors
.
APIError
)
as
exc
:
self
.
client
.
build
(
fileobj
=
io
.
BytesIO
(),
tag
=
"a/b/c"
)
self
.
assertEqual
(
exc
.
response
.
status_code
,
500
)
for
line
in
self
.
client
.
build
(
fileobj
=
dfile
,
tag
=
"a/b/c"
):
pass
self
.
assertEqual
(
exc
.
exception
.
response
.
status_code
,
500
)
dfile
.
close
()
if
__name__
==
'__main__'
:
...
...
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