Add integration test for restart command
Signed-off-by: Mark Steve Samson <hello@marksteve.com>
This commit is contained in:
parent
9d55e01e2a
commit
e224c4caa4
1 changed files with 16 additions and 0 deletions
|
|
@ -192,6 +192,22 @@ class CLITestCase(DockerClientTestCase):
|
||||||
self.command.dispatch(['rm', '--force'], None)
|
self.command.dispatch(['rm', '--force'], None)
|
||||||
self.assertEqual(len(service.containers(stopped=True)), 0)
|
self.assertEqual(len(service.containers(stopped=True)), 0)
|
||||||
|
|
||||||
|
def test_restart(self):
|
||||||
|
service = self.project.get_service('simple')
|
||||||
|
container = service.create_container()
|
||||||
|
service.start_container(container)
|
||||||
|
started_at = container.dictionary['State']['StartedAt']
|
||||||
|
self.command.dispatch(['restart'], None)
|
||||||
|
container.inspect()
|
||||||
|
self.assertNotEqual(
|
||||||
|
container.dictionary['State']['FinishedAt'],
|
||||||
|
'0001-01-01T00:00:00Z',
|
||||||
|
)
|
||||||
|
self.assertNotEqual(
|
||||||
|
container.dictionary['State']['StartedAt'],
|
||||||
|
started_at,
|
||||||
|
)
|
||||||
|
|
||||||
def test_scale(self):
|
def test_scale(self):
|
||||||
project = self.project
|
project = self.project
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue