Merge pull request #393 from marksteve/restart

Implement restart command (Closes #98)
This commit is contained in:
Ben Firshman 2014-09-08 17:47:08 +01:00
commit ce8ef23c09
5 changed files with 37 additions and 0 deletions

View file

@ -194,6 +194,22 @@ class CLITestCase(DockerClientTestCase):
self.command.dispatch(['rm', '--force'], None)
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):
project = self.project