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
75497e07
Kaydet (Commit)
75497e07
authored
Haz 15, 2016
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add test for import_image with changes param
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
65fb5be4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
3 deletions
+44
-3
Makefile
Makefile
+2
-3
image_test.py
tests/integration/image_test.py
+42
-0
No files found.
Makefile
Dosyayı görüntüle @
75497e07
...
@@ -3,9 +3,8 @@
...
@@ -3,9 +3,8 @@
all
:
test
all
:
test
clean
:
clean
:
rm
-rf
tests/__pycache__
-
docker
rm
-vf
dpy-dind
rm
-rf
tests/
*
/__pycache__
find
-name
"__pycache__"
| xargs
rm
-rf
docker
rm
-vf
dpy-dind
build
:
build
:
docker build
-t
docker-py .
docker build
-t
docker-py .
...
...
tests/integration/image_test.py
Dosyayı görüntüle @
75497e07
...
@@ -208,6 +208,48 @@ class ImportImageTest(helpers.BaseTestCase):
...
@@ -208,6 +208,48 @@ class ImportImageTest(helpers.BaseTestCase):
img_id
=
result
[
'status'
]
img_id
=
result
[
'status'
]
self
.
tmp_imgs
.
append
(
img_id
)
self
.
tmp_imgs
.
append
(
img_id
)
def
test_import_image_from_data_with_changes
(
self
):
with
self
.
dummy_tar_stream
(
n_bytes
=
500
)
as
f
:
content
=
f
.
read
()
statuses
=
self
.
client
.
import_image_from_data
(
content
,
repository
=
'test/import-from-bytes'
,
changes
=
[
'USER foobar'
,
'CMD ["echo"]'
]
)
result_text
=
statuses
.
splitlines
()[
-
1
]
result
=
json
.
loads
(
result_text
)
assert
'error'
not
in
result
img_id
=
result
[
'status'
]
self
.
tmp_imgs
.
append
(
img_id
)
img_data
=
self
.
client
.
inspect_image
(
img_id
)
assert
img_data
is
not
None
assert
img_data
[
'Config'
][
'Cmd'
]
==
[
'echo'
]
assert
img_data
[
'Config'
][
'User'
]
==
'foobar'
def
test_import_image_with_changes
(
self
):
with
self
.
dummy_tar_file
(
n_bytes
=
self
.
TAR_SIZE
)
as
tar_filename
:
statuses
=
self
.
client
.
import_image
(
src
=
tar_filename
,
repository
=
'test/import-from-file'
,
changes
=
[
'USER foobar'
,
'CMD ["echo"]'
]
)
result_text
=
statuses
.
splitlines
()[
-
1
]
result
=
json
.
loads
(
result_text
)
assert
'error'
not
in
result
img_id
=
result
[
'status'
]
self
.
tmp_imgs
.
append
(
img_id
)
img_data
=
self
.
client
.
inspect_image
(
img_id
)
assert
img_data
is
not
None
assert
img_data
[
'Config'
][
'Cmd'
]
==
[
'echo'
]
assert
img_data
[
'Config'
][
'User'
]
==
'foobar'
@contextlib.contextmanager
@contextlib.contextmanager
def
temporary_http_file_server
(
self
,
stream
):
def
temporary_http_file_server
(
self
,
stream
):
'''Serve data from an IO stream over HTTP.'''
'''Serve data from an IO stream over HTTP.'''
...
...
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