Skip to content

Commit

Permalink
test: add coverage for service rollback_config
Browse files Browse the repository at this point in the history
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
  • Loading branch information
milas committed Jul 29, 2022
1 parent 16960b6 commit 110db86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/integration/models_services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ def test_create(self):
# ContainerSpec arguments
image="alpine",
command="sleep 300",
container_labels={'container': 'label'}
container_labels={'container': 'label'},
rollback_config={'order': 'start-first'}
)
assert service.name == name
assert service.attrs['Spec']['Labels']['foo'] == 'bar'
container_spec = service.attrs['Spec']['TaskTemplate']['ContainerSpec']
assert "alpine" in container_spec['Image']
assert container_spec['Labels'] == {'container': 'label'}
assert service.attrs['Spec']['RollbackConfig']['Order'] == 'start-first'

def test_create_with_network(self):
client = docker.from_env(version=TEST_API_VERSION)
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/models_services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def test_get_create_service_kwargs(self):
'labels': {'key': 'value'},
'hostname': 'test_host',
'mode': 'global',
'rollback_config': {'rollback': 'config'},
'update_config': {'update': 'config'},
'networks': ['somenet'],
'endpoint_spec': {'blah': 'blah'},
Expand All @@ -37,6 +38,7 @@ def test_get_create_service_kwargs(self):
'name': 'somename',
'labels': {'key': 'value'},
'mode': 'global',
'rollback_config': {'rollback': 'config'},
'update_config': {'update': 'config'},
'endpoint_spec': {'blah': 'blah'},
}
Expand Down

0 comments on commit 110db86

Please sign in to comment.