Skip to content

Commit

Permalink
test bbb stubst to increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgross committed Jan 30, 2016
1 parent 0acd301 commit 6703046
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/zLOG/tests/testzLog.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,23 @@ def test_error(self):
with self.getLogFile() as f:
self.verifyEntry(f, subsys="basic", summary="summary")
self.verifyEntry(f, subsys="basic", severity=zLOG.ERROR, error=err)

def test_reraise_error(self):
self.setLog()
try:
1 / 0
except ZeroDivisionError:
err = sys.exc_info()

self.assertRaises(ZeroDivisionError, zLOG.LOG, "basic", zLOG.ERROR,
"raised exception", error=err, reraise=True)
with self.getLogFile() as f:
self.verifyEntry(f, subsys="basic", severity=zLOG.ERROR, error=err)

def test_bbb(self):
""" test existence of backwards compatibility methods that do nothing
"""
zLOG.initialize()
zLOG.set_initializer(lambda :False)
zLOG.register_subsystem('foo')
self.assertTrue('foo' in zLOG._subsystems)

0 comments on commit 6703046

Please sign in to comment.