Review: Needs Fixing

437     + if key in self.service_list:
438     + log.error(u'Duplicate service exception %s' % key)
439     + raise Exception(u'Duplicate service exception %s' % key)

Rather raise a more specific exception, like KeyError.


2271    + # WHEN: I add a service it should save it a second time
2272    + # THEN I will get an exception
2273    + try:
2274    + Registry().register(u'test1', mock_1)
2275    + except Exception, e:
2276    + pass

Use self.assertRaises(), like so:

# WHEN: I add a service it should save it a second time
# THEN I will get an exception
self.assertRaises(KeyError, Registry().register(u'test1', mock_1))

-- 
https://code.launchpad.net/~trb143/openlp/singleton/+merge/144640
Your team OpenLP Core is subscribed to branch lp:openlp.

_______________________________________________
Mailing list: https://launchpad.net/~openlp-core
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to