Commit 935048b1 authored by Trevor Cappallo's avatar Trevor Cappallo
Browse files

add unit tests

parent 2e66e5b5
#!/usr/bin/env python
"""Unit tests for OperationalLogging."""
import unittest
from nose.tools import raises, eq_
import logging
import OperationalLogger as OpLog
class TestCritical(unittest.TestCase):
def setUp(self):
OpLog.setup(notify={'DEBUG':'tcappallo@veriskclimate.com'})
def tearDown(self):
pass
def test_debug(self):
logging.getLogger().debug("This is a debug statement.")
def test_error(self):
logging.getLogger().error("This is an error statement.")
def test_critical(self):
logging.getLogger().critical("This is a critical statement.")
if __name__ == '__main__':
unittest.main()
#!/usr/bin/env python
"""Unit tests for OperationalLogging."""
import unittest
from nose.tools import raises, eq_
import logging
import OperationalLogger as OpLog
class TestCritical(unittest.TestCase):
def setUp(self):
OpLog.setup(notify={'ERROR':'tcappallo@veriskclimate.com'})
def tearDown(self):
pass
def test_unicode(self):
logging.getLogger(__name__).info("This has a __name__.")
logging.getLogger().info("This has no __name__.")
logging.getLogger(__name__).info("This has a unicode string here -->%s<--", u"\xe2\xe3")
logging.getLogger(__name__).info(u"This has a unicode character here -->\xe2\xe3<--")
if __name__ == '__main__':
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment