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
c03a009e
Unverified
Kaydet (Commit)
c03a009e
authored
Haz 16, 2017
tarafından
Chris Mark
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Raising error in case of invalid value of since kwarg on Container.logs
Signed-off-by:
Chris Mark
<
chrismarkou92@gmail.com
>
üst
8fc6540f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
container.py
docker/api/container.py
+5
-0
api_container_test.py
tests/unit/api_container_test.py
+7
-0
No files found.
docker/api/container.py
Dosyayı görüntüle @
c03a009e
...
@@ -825,6 +825,11 @@ class ContainerApiMixin(object):
...
@@ -825,6 +825,11 @@ class ContainerApiMixin(object):
params
[
'since'
]
=
utils
.
datetime_to_timestamp
(
since
)
params
[
'since'
]
=
utils
.
datetime_to_timestamp
(
since
)
elif
(
isinstance
(
since
,
int
)
and
since
>
0
):
elif
(
isinstance
(
since
,
int
)
and
since
>
0
):
params
[
'since'
]
=
since
params
[
'since'
]
=
since
else
:
raise
errors
.
InvalidArgument
(
'since value should be datetime or int, not {}'
.
format
(
type
(
since
))
)
url
=
self
.
_url
(
"/containers/{0}/logs"
,
container
)
url
=
self
.
_url
(
"/containers/{0}/logs"
,
container
)
res
=
self
.
_get
(
url
,
params
=
params
,
stream
=
stream
)
res
=
self
.
_get
(
url
,
params
=
params
,
stream
=
stream
)
return
self
.
_get_result
(
container
,
stream
,
res
)
return
self
.
_get_result
(
container
,
stream
,
res
)
...
...
tests/unit/api_container_test.py
Dosyayı görüntüle @
c03a009e
...
@@ -1421,6 +1421,13 @@ class ContainerTest(BaseAPIClientTest):
...
@@ -1421,6 +1421,13 @@ class ContainerTest(BaseAPIClientTest):
stream
=
False
stream
=
False
)
)
def
test_log_since_with_invalid_value_raises_error
(
self
):
with
mock
.
patch
(
'docker.api.client.APIClient.inspect_container'
,
fake_inspect_container
):
with
self
.
assertRaises
(
docker
.
errors
.
InvalidArgument
):
self
.
client
.
logs
(
fake_api
.
FAKE_CONTAINER_ID
,
stream
=
False
,
follow
=
False
,
since
=
42.42
)
def
test_log_tty
(
self
):
def
test_log_tty
(
self
):
m
=
mock
.
Mock
()
m
=
mock
.
Mock
()
with
mock
.
patch
(
'docker.api.client.APIClient.inspect_container'
,
with
mock
.
patch
(
'docker.api.client.APIClient.inspect_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