def test_get_file_template(self): # test with a valid template self.assertEqual(NeuronModule._get_file_template(self.file_template, self.message), self.expected_result) # test raise with a non existing template file_template = "does_not_exist.j2" with self.assertRaises(TemplateFileNotFoundException): NeuronModule._get_file_template(file_template, self.message)
def test_get_file_template(self): # test with a valid template self.assertEqual( NeuronModule._get_file_template(self.file_template, self.message), self.expected_result) # test raise with a non existing template file_template = "does_not_exist.j2" with self.assertRaises(TemplateFileNotFoundException): NeuronModule._get_file_template(file_template, self.message)
def test_get_file_template(self): # test with a valid template self.assertEqual(NeuronModule._get_file_template(self.file_template, self.message), self.expected_result) # test with kalliope memory Cortex.memory = { "kalliope_last_tts_message": "memory" } expected = "hello, this is a replaced word with memory" self.assertEqual(NeuronModule._get_file_template(self.file_template_contains_kalliope_memory, self.message), expected) # test raise with a non existing template file_template = "does_not_exist.j2" with self.assertRaises(TemplateFileNotFoundException): NeuronModule._get_file_template(file_template, self.message)