diff --git a/tests/functional/openlp_core_lib/test_registry.py b/tests/functional/openlp_core_lib/test_registry.py index 6e9e8fe7f..b10afe0cc 100644 --- a/tests/functional/openlp_core_lib/test_registry.py +++ b/tests/functional/openlp_core_lib/test_registry.py @@ -31,14 +31,14 @@ class TestRegistry(TestCase): # THEN and I will get an exception with self.assertRaises(KeyError) as context: Registry().register(u'test1', mock_1) - self.assertEqual(context.exception[0], u'Duplicate service exception test1', + self.assertEqual(context.exception, u'Duplicate service exception test1', u'KeyError exception should have been thrown for duplicate service') # WHEN I try to get back a non existent component # THEN I will get an exception with self.assertRaises(KeyError) as context: temp = Registry().get(u'test2') - self.assertEqual(context.exception[0], u'Service test2 not found in list', + self.assertEqual(context.exception, u'Service test2 not found in list', u'KeyError exception should have been thrown for missing service') # WHEN I try to replace a component I should be allowed (testing only) @@ -46,7 +46,7 @@ class TestRegistry(TestCase): # THEN I will get an exception with self.assertRaises(KeyError) as context: temp = Registry().get(u'test1') - self.assertEqual(context.exception[0], u'Service test1 not found in list', + self.assertEqual(context.exception, u'Service test1 not found in list', u'KeyError exception should have been thrown for deleted service') def registry_function_test(self): @@ -81,4 +81,5 @@ class TestRegistry(TestCase): return "function_1" def dummy_function_2(self): - return "function_2" \ No newline at end of file + return "function_2" +