mirror of https://github.com/docker/docker-py.git
Merge eaa6ffaa46
into 526a9db743
This commit is contained in:
commit
56d2ef28d7
|
@ -23,9 +23,12 @@ class LogConfigTypesEnum:
|
||||||
'journald',
|
'journald',
|
||||||
'gelf',
|
'gelf',
|
||||||
'fluentd',
|
'fluentd',
|
||||||
|
'awslogs',
|
||||||
|
'splunk',
|
||||||
|
'etwlogs',
|
||||||
'none'
|
'none'
|
||||||
)
|
)
|
||||||
JSON, SYSLOG, JOURNALD, GELF, FLUENTD, NONE = _values
|
JSON, SYSLOG, JOURNALD, GELF, FLUENTD, AWS, SPLUNK, ETW, NONE = _values
|
||||||
|
|
||||||
|
|
||||||
class LogConfig(DictType):
|
class LogConfig(DictType):
|
||||||
|
|
|
@ -269,9 +269,13 @@ class UlimitTest(unittest.TestCase):
|
||||||
Ulimit(name='hello', hard='456')
|
Ulimit(name='hello', hard='456')
|
||||||
|
|
||||||
|
|
||||||
class LogConfigTest(unittest.TestCase):
|
@pytest.mark.parametrize(
|
||||||
def test_create_host_config_dict_logconfig(self):
|
"log_config_type",
|
||||||
dct = {'type': LogConfig.types.SYSLOG, 'config': {'key1': 'val1'}}
|
[LogConfig.types.SYSLOG, LogConfig.types.AWS]
|
||||||
|
)
|
||||||
|
class LogConfigTest:
|
||||||
|
def test_create_host_config_dict_logconfig(self, log_config_type):
|
||||||
|
dct = {'type': log_config_type, 'config': {'key1': 'val1'}}
|
||||||
config = create_host_config(
|
config = create_host_config(
|
||||||
version=DEFAULT_DOCKER_API_VERSION, log_config=dct
|
version=DEFAULT_DOCKER_API_VERSION, log_config=dct
|
||||||
)
|
)
|
||||||
|
@ -279,8 +283,8 @@ class LogConfigTest(unittest.TestCase):
|
||||||
assert isinstance(config['LogConfig'], LogConfig)
|
assert isinstance(config['LogConfig'], LogConfig)
|
||||||
assert dct['type'] == config['LogConfig'].type
|
assert dct['type'] == config['LogConfig'].type
|
||||||
|
|
||||||
def test_create_host_config_obj_logconfig(self):
|
def test_create_host_config_obj_logconfig(self, log_config_type):
|
||||||
obj = LogConfig(type=LogConfig.types.SYSLOG, config={'key1': 'val1'})
|
obj = LogConfig(type=log_config_type, config={'key1': 'val1'})
|
||||||
config = create_host_config(
|
config = create_host_config(
|
||||||
version=DEFAULT_DOCKER_API_VERSION, log_config=obj
|
version=DEFAULT_DOCKER_API_VERSION, log_config=obj
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue