Alle Dateien aus dem Pythonkurs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

28 lines
607 B

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()