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()
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()
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()
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()
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()
def test_on_mute(self): """ test that empty list of synapse return none """ self.assertIsNone(HookManager.on_mute())
def test_on_order_found(self): self.assertIsNone(HookManager.on_order_found())
def test_on_stop_listening(self): self.assertIsNone(HookManager.on_stop_listening())
def test_on_processed_synapses(self): self.assertIsNone(HookManager.on_processed_synapses())
def test_on_deaf(self): """ test that empty list of synapse return none """ self.assertIsNone(HookManager.on_deaf())
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()