示例#1
0
 def test_on_order_not_found(self):
     with mock.patch("brain.core.SynapseLauncher.start_synapse_by_list_name"
                     ) as mock_synapse_launcher:
         HookManager.on_order_not_found()
         mock_synapse_launcher.assert_called_with(
             ["order-not-found-synapse"], new_lifo=True)
         mock_synapse_launcher.reset_mock()
示例#2
0
 def test_on_waiting_for_trigger(self):
     """
     test with single synapse 
     """
     with mock.patch("brain.core.SynapseLauncher.start_synapse_by_list_name"
                     ) as mock_synapse_launcher:
         HookManager.on_waiting_for_trigger()
         mock_synapse_launcher.assert_called_with(["test"], new_lifo=True)
         mock_synapse_launcher.reset_mock()
示例#3
0
 def test_on_start(self):
     """
     test list of synapse
     """
     with mock.patch("brain.core.SynapseLauncher.start_synapse_by_list_name"
                     ) as mock_synapse_launcher:
         HookManager.on_start()
         mock_synapse_launcher.assert_called_with(
             ["on-start-synapse", "bring-led-on"], new_lifo=True)
         mock_synapse_launcher.reset_mock()
示例#4
0
 def test_on_deaf(self):
     """
     test that empty list of synapse return none
     """
     self.assertIsNone(HookManager.on_deaf())
示例#5
0
 def test_on_processed_synapses(self):
     self.assertIsNone(HookManager.on_processed_synapses())
示例#6
0
 def test_on_order_found(self):
     self.assertIsNone(HookManager.on_order_found())
示例#7
0
 def test_on_stop_listening(self):
     self.assertIsNone(HookManager.on_stop_listening())