コード例 #1
0
 def test_shutdown_message_advances_to_idle_and_sends_notification(self):
     with self.assertRaises(IdleError) as context:
         self.state_machine.event(EventShutdown(), self.tick)
     self.assertTrue("Shutdown requested" in str(context.exception))
     self.assertEqual(self.state_machine.state, "idle")
     self.assertEqual(self.state_machine.output_messages.qsize(), 1)
     message = self.state_machine.output_messages.get()
     self.assertEqual(message.error_code, 6) # Cease
コード例 #2
0
 def test_shutdown_message_advances_to_idle(self):
     with self.assertRaises(IdleError) as context:
         self.state_machine.event(EventShutdown(), self.tick)
     self.assertEqual(self.state_machine.state, "idle")
     self.assertTrue("Shutdown requested" in str(context.exception))