Пример #1
0
 def test_tabs(self):
     # Python will treat the tab as just one character. Since we
     # don't know the size of tab stops, we will just treat it that
     # way as well. Solution: Don't use TABs in your header.
     self.assertEqual(
         header('Tab\tincoming', '*'),
         'Tab' '\t' 'incoming\n'
         '***' '*'  '********')
Пример #2
0
 def test_empty(self):
     self.assertEqual(header(''), '\n')
Пример #3
0
 def test_custom_char(self):
     self.assertEqual(
         header('Just a header', '#'),
         'Just a header\n'
         '#############')
Пример #4
0
 def test_just_spaces(self):
     self.assertEqual(
         header('       ', '%'),
         '       \n'
         '%%%%%%%')
Пример #5
0
 def test_default(self):
     self.assertEqual(
         header('This is a test'),
         'This is a test\n'
         '==============')