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
e7a9ae09
Kaydet (Commit)
e7a9ae09
authored
Agu 26, 2015
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Don't remove LogConfig.types shortcut
üst
9937a31a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
types.py
docker/utils/types.py
+1
-0
utils_test.py
tests/utils_test.py
+6
-2
No files found.
docker/utils/types.py
Dosyayı görüntüle @
e7a9ae09
...
...
@@ -20,6 +20,7 @@ class DictType(dict):
class
LogConfig
(
DictType
):
types
=
LogConfigTypesEnum
def
__init__
(
self
,
**
kwargs
):
log_driver_type
=
kwargs
.
get
(
'type'
,
kwargs
.
get
(
'Type'
))
...
...
tests/utils_test.py
Dosyayı görüntüle @
e7a9ae09
...
...
@@ -192,19 +192,23 @@ class UtilsTest(base.BaseTestCase):
self
.
assertRaises
(
ValueError
,
lambda
:
Ulimit
(
name
=
'hello'
,
hard
=
'456'
))
def
test_create_host_config_dict_logconfig
(
self
):
dct
=
{
'type'
:
'syslog'
,
'config'
:
{
'key1'
:
'val1'
}}
dct
=
{
'type'
:
LogConfig
.
types
.
SYSLOG
,
'config'
:
{
'key1'
:
'val1'
}}
config
=
create_host_config
(
log_config
=
dct
)
self
.
assertIn
(
'LogConfig'
,
config
)
self
.
assertTrue
(
isinstance
(
config
[
'LogConfig'
],
LogConfig
))
self
.
assertEqual
(
dct
[
'type'
],
config
[
'LogConfig'
]
.
type
)
def
test_create_host_config_obj_logconfig
(
self
):
obj
=
LogConfig
(
type
=
'syslog'
,
config
=
{
'key1'
:
'val1'
})
obj
=
LogConfig
(
type
=
LogConfig
.
types
.
SYSLOG
,
config
=
{
'key1'
:
'val1'
})
config
=
create_host_config
(
log_config
=
obj
)
self
.
assertIn
(
'LogConfig'
,
config
)
self
.
assertTrue
(
isinstance
(
config
[
'LogConfig'
],
LogConfig
))
self
.
assertEqual
(
obj
,
config
[
'LogConfig'
])
def
test_logconfig_invalid_config_type
(
self
):
with
pytest
.
raises
(
ValueError
):
LogConfig
(
type
=
LogConfig
.
types
.
JSON
,
config
=
'helloworld'
)
def
test_resolve_repository_name
(
self
):
# docker hub library image
self
.
assertEqual
(
...
...
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