← Back to team overview

openlp-core team mailing list archive

Re: [Merge] lp:~trb143/openlp/singleton into lp:openlp

 

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.


References