コード例 #1
0
 def test_on_waiting_for_trigger(self):
     """
     test with single synapse 
     """
     with mock.patch("kalliope.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()
コード例 #2
0
 def test_on_order_not_found(self):
     with mock.patch(
             "kalliope.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()
コード例 #3
0
 def test_on_start(self):
     """
     test list of synapse
     """
     with mock.patch("kalliope.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_waiting_for_trigger(self):
     """
     test with single synapse 
     """
     with mock.patch("kalliope.core.SynapseLauncher.start_synapse_by_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()
コード例 #5
0
 def test_on_start(self):
     """
     test list of synapse
     """
     with mock.patch(
             "kalliope.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()
コード例 #6
0
 def test_on_mute(self):
     """
     test that empty list of synapse return none
     """
     self.assertIsNone(HookManager.on_mute())
コード例 #7
0
 def test_on_order_found(self):
     self.assertIsNone(HookManager.on_order_found())
コード例 #8
0
 def test_on_stop_listening(self):
     self.assertIsNone(HookManager.on_stop_listening())
コード例 #9
0
 def test_on_processed_synapses(self):
     self.assertIsNone(HookManager.on_processed_synapses())
コード例 #10
0
 def test_on_deaf(self):
     """
     test that empty list of synapse return none
     """
     self.assertIsNone(HookManager.on_deaf())
コード例 #11
0
 def test_on_processed_synapses(self):
     self.assertIsNone(HookManager.on_processed_synapses())
コード例 #12
0
 def test_on_order_not_found(self):
     with mock.patch("kalliope.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()
コード例 #13
0
 def test_on_order_found(self):
     self.assertIsNone(HookManager.on_order_found())
コード例 #14
0
 def test_on_stop_listening(self):
     self.assertIsNone(HookManager.on_stop_listening())