Skip to content

Commit

Permalink
Minor cleanup of test case for keyword registration
Browse files Browse the repository at this point in the history
  • Loading branch information
forslund committed Aug 2, 2021
1 parent 627cded commit a1f9bd5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/unittests/skills/test_intent_service_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ def reset(self):
self.results = []


class FunctionTest(unittest.TestCase):
def check_emitter(self, result_list):
for type in self.emitter.get_types():
self.assertEqual(type, 'register_vocab')
self.assertEqual(sorted(self.emitter.get_results(),
key=lambda d: sorted(d.items())),
sorted(result_list, key=lambda d: sorted(d.items())))
class KeywordRegistrationTest(unittest.TestCase):
def check_emitter(self, expected_message_data):
"""Verify that the registration messages matches the expected."""
for msg_type in self.emitter.get_types():
self.assertEqual(msg_type, 'register_vocab')
self.assertEqual(
sorted(self.emitter.get_results(),
key=lambda d: sorted(d.items())),
sorted(expected_message_data, key=lambda d: sorted(d.items())))
self.emitter.reset()

def setUp(self):
Expand Down

0 comments on commit a1f9bd5

Please sign in to comment.