forked from openlp/openlp
'fixed' tests
This commit is contained in:
parent
161a1db12d
commit
55fbe75695
@ -31,14 +31,14 @@ class TestRegistry(TestCase):
|
|||||||
# THEN and I will get an exception
|
# THEN and I will get an exception
|
||||||
with self.assertRaises(KeyError) as context:
|
with self.assertRaises(KeyError) as context:
|
||||||
Registry().register(u'test1', mock_1)
|
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')
|
u'KeyError exception should have been thrown for duplicate service')
|
||||||
|
|
||||||
# WHEN I try to get back a non existent component
|
# WHEN I try to get back a non existent component
|
||||||
# THEN I will get an exception
|
# THEN I will get an exception
|
||||||
with self.assertRaises(KeyError) as context:
|
with self.assertRaises(KeyError) as context:
|
||||||
temp = Registry().get(u'test2')
|
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')
|
u'KeyError exception should have been thrown for missing service')
|
||||||
|
|
||||||
# WHEN I try to replace a component I should be allowed (testing only)
|
# 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
|
# THEN I will get an exception
|
||||||
with self.assertRaises(KeyError) as context:
|
with self.assertRaises(KeyError) as context:
|
||||||
temp = Registry().get(u'test1')
|
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')
|
u'KeyError exception should have been thrown for deleted service')
|
||||||
|
|
||||||
def registry_function_test(self):
|
def registry_function_test(self):
|
||||||
@ -82,3 +82,4 @@ class TestRegistry(TestCase):
|
|||||||
|
|
||||||
def dummy_function_2(self):
|
def dummy_function_2(self):
|
||||||
return "function_2"
|
return "function_2"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user