import unittest import logging from name import Name __LOGLEVEL__ = logging.DEBUG logging.basicConfig( format='%(asctime)-15s [%(levelname)s] %(funcName)s: %(message)s', level=__LOGLEVEL__) class TestName(unittest.TestCase): def setUp(self): logging.debug('setting up test') self.name = Name('Homer', 'Simpson') def test_getattr(self): fullname = self.name.fullname sortname = self.name.sortname self.assertEqual('Homer Simpson', fullname) self.assertEqual('Simpson,Homer', sortname) if __name__ == '__main__': logging.debug('Test startet.') unittest.main()