Exemplo n.º 1
0
 def test_command_finished(self):
     command = Command('command-1')
     assert_that(command.is_finished(), is_(False))
     command.start()
     assert_that(command.is_finished(), is_(False))
     command.done()
     assert_that(command.is_finished(), is_(True))
Exemplo n.º 2
0
 def test_command_state(self):
     command = Command('command-1')
     assert_that(command.state(), is_(State.QUEUED))
     command.start()
     assert_that(command.state(), is_(State.STARTED))
     command.done()
     assert_that(command.state(), is_(State.DONE))
Exemplo n.º 3
0
 def test_command_fail_result(self):
     command = Command('command-1')
     assert_that(command.state(), is_(State.QUEUED))
     command.start()
     assert_that(command.state(), is_(State.STARTED))
     command.fail('failed')
     assert_that(command.state(), is_(State.FAIL))
     assert_that(command.result, is_('failed'))