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))
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))
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'))