Example #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()
Example #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()
Example #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()
Example #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()
Example #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()
Example #6
0
 def test_on_mute(self):
     """
     test that empty list of synapse return none
     """
     self.assertIsNone(HookManager.on_mute())
Example #7
0
 def test_on_order_found(self):
     self.assertIsNone(HookManager.on_order_found())
Example #8
0
 def test_on_stop_listening(self):
     self.assertIsNone(HookManager.on_stop_listening())
 def test_on_processed_synapses(self):
     self.assertIsNone(HookManager.on_processed_synapses())
Example #10
0
 def test_on_deaf(self):
     """
     test that empty list of synapse return none
     """
     self.assertIsNone(HookManager.on_deaf())
Example #11
0
 def test_on_processed_synapses(self):
     self.assertIsNone(HookManager.on_processed_synapses())
Example #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()
Example #13
0
 def test_on_order_found(self):
     self.assertIsNone(HookManager.on_order_found())
Example #14
0
 def test_on_stop_listening(self):
     self.assertIsNone(HookManager.on_stop_listening())