Example #1
0
 def test__table__should_return_a_constant_width_string(self):
     tf1 = TextFormatter(self.record_list)
     txt = tf1.table()
     lengths = [len(line) for line in txt.split("\n")[:-1]]
     for l in lengths:
         assert l == lengths[0]
Example #2
0
 def test__table__should_return_a_constant_width_string(self):
     tf1 = TextFormatter(self.record_list)
     txt = tf1.table()
     lengths = [len(line) for line in txt.split("\n")[:-1]]
     for l in lengths:
         assert l == lengths[0]
Example #3
0
 def test__format__should_call_the_appropriate_method(self):
     tf1 = TextFormatter(self.record_list)
     self.assertEqual(tf1.format(mode='short'), tf1.short())
     self.assertEqual(tf1.format(mode='long'), tf1.long())
     self.assertEqual(tf1.format(mode='table'), tf1.table())
Example #4
0
 def test__format__should_call_the_appropriate_method(self):
     tf1 = TextFormatter(self.record_list)
     self.assertEqual(tf1.format(mode='short'), tf1.short())
     self.assertEqual(tf1.format(mode='long'), tf1.long())
     self.assertEqual(tf1.format(mode='table'), tf1.table())