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
8316fa4e
Kaydet (Commit)
8316fa4e
authored
Nis 23, 2015
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #555 from docker/client_side_trunc
Handle ID truncate on client side in containers list
üst
7e7d8ee7
6228929a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
client.py
docker/client.py
+4
-1
integration_test.py
tests/integration_test.py
+8
-4
test.py
tests/test.py
+1
-1
No files found.
docker/client.py
Dosyayı görüntüle @
8316fa4e
...
...
@@ -411,7 +411,7 @@ class Client(requests.Session):
return
self
.
_result
(
self
.
_post_json
(
u
,
data
=
conf
,
params
=
params
),
json
=
True
)
def
containers
(
self
,
quiet
=
False
,
all
=
False
,
trunc
=
Tru
e
,
latest
=
False
,
def
containers
(
self
,
quiet
=
False
,
all
=
False
,
trunc
=
Fals
e
,
latest
=
False
,
since
=
None
,
before
=
None
,
limit
=-
1
,
size
=
False
,
filters
=
None
):
params
=
{
...
...
@@ -429,6 +429,9 @@ class Client(requests.Session):
if
quiet
:
return
[{
'Id'
:
x
[
'Id'
]}
for
x
in
res
]
if
trunc
:
for
x
in
res
:
x
[
'Id'
]
=
x
[
'Id'
][:
12
]
return
res
def
copy
(
self
,
container
,
resource
):
...
...
tests/integration_test.py
Dosyayı görüntüle @
8316fa4e
...
...
@@ -1681,10 +1681,7 @@ class UnixconnTestCase(unittest.TestCase):
# REGRESSION TESTS #
####################
class
TestRegressions
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
client
=
docker
.
Client
(
timeout
=
5
,
base_url
=
DEFAULT_BASE_URL
)
class
TestRegressions
(
BaseTestCase
):
def
test_443
(
self
):
dfile
=
io
.
BytesIO
()
with
self
.
assertRaises
(
docker
.
errors
.
APIError
)
as
exc
:
...
...
@@ -1693,6 +1690,13 @@ class TestRegressions(unittest.TestCase):
self
.
assertEqual
(
exc
.
exception
.
response
.
status_code
,
500
)
dfile
.
close
()
def
test_542
(
self
):
self
.
client
.
start
(
self
.
client
.
create_container
(
'busybox'
,
[
'true'
])
)
result
=
self
.
client
.
containers
(
trunc
=
True
)
self
.
assertEqual
(
len
(
result
[
0
][
'Id'
]),
12
)
if
__name__
==
'__main__'
:
c
=
docker
.
Client
(
base_url
=
DEFAULT_BASE_URL
)
...
...
tests/test.py
Dosyayı görüntüle @
8316fa4e
...
...
@@ -312,7 +312,7 @@ class DockerClientTest(Cleanup, base.BaseTestCase):
'since'
:
None
,
'size'
:
0
,
'limit'
:
-
1
,
'trunc_cmd'
:
1
,
'trunc_cmd'
:
0
,
'before'
:
None
},
timeout
=
docker
.
client
.
DEFAULT_TIMEOUT_SECONDS
...
...
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