Skip to content

Commit

Permalink
Add tests for new hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaboniface committed Jun 6, 2023
1 parent 311675c commit 2c4fba1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Tests/settings/settings_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ hooks:
- "on-triggered-synapse"
on_start_listening:
on_stop_listening:
on_start_stt_processing:
on_stop_stt_processing:
on_order_found:
on_order_not_found:
- "order-not-found-synapse"
Expand Down Expand Up @@ -121,4 +123,4 @@ options:
energy_threshold: 3000

# send hit to anonymously evaluate the global usage of Kalliope app by users
send_anonymous_usage_stats: False
send_anonymous_usage_stats: False
6 changes: 6 additions & 0 deletions Tests/test_hook_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ def test_on_start_listening(self):
def test_on_stop_listening(self):
self.assertIsNone(HookManager.on_stop_listening())

def test_on_start_stt_processing(self):
self.assertIsNone(HookManager.on_start_stt_processing())

def test_on_stop_stt_processing(self):
self.assertIsNone(HookManager.on_stop_stt_processing())

def test_on_order_found(self):
self.assertIsNone(HookManager.on_order_found())

Expand Down
6 changes: 6 additions & 0 deletions Tests/test_settings_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def setUp(self):
'hooks': {'on_waiting_for_trigger': 'test',
'on_stop_listening': None,
'on_start_listening': None,
'on_stop_stt_processing': None,
'on_start_stt_processing': None,
'on_order_found': None,
'on_start': ['on-start-synapse', 'bring-led-on'],
'on_undeaf': [],
Expand Down Expand Up @@ -250,6 +252,8 @@ def test_get_hooks(self):
"on_triggered": None,
"on_start_listening": None,
"on_stop_listening": None,
"on_start_stt_processing": None,
"on_stop_stt_processing": None,
"on_order_found": None,
"on_order_not_found": None,
"on_deaf": None,
Expand All @@ -273,6 +277,8 @@ def test_get_hooks(self):
"on_triggered": None,
"on_start_listening": None,
"on_stop_listening": None,
"on_start_stt_processing": None,
"on_stop_stt_processing": None,
"on_order_found": None,
"on_order_not_found": None,
"on_deaf": None,
Expand Down

0 comments on commit 2c4fba1

Please sign in to comment.