def test_positive_1(self): conveyor = Conveyor([Ok(), FailedOnlyFirstCall(), Ok()]) conveyor.power_on() self.assertTrue(all([c.state == CommandState.Done for c in conveyor.commands]))
def _do(self, commands, exspected_states, exception): conveyor = Conveyor(commands) with self.assertRaises(exception): conveyor.power_on() states = [c.state for c in conveyor.commands] self.assertListEqual(exspected_states, states)