Exemple #1
0
 def test__long__with_non_ascii_username(self):
     self.record_list[0].user = "******"
     tf1 = TextFormatter(self.record_list)
     txt = tf1.long()
     assert "Erdős" in txt
Exemple #2
0
 def test__long__should_return_a_fixed_width_string(self):
     tf1 = TextFormatter(self.record_list)
     txt = tf1.long()
     lengths = [len(line) for line in txt.split("\n")]
     self.assert_(max(lengths) <= 80)
Exemple #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())
Exemple #4
0
 def test__long__should_return_a_fixed_width_string(self):
     tf1 = TextFormatter(self.record_list)
     txt = tf1.long()
     lengths = [len(line) for line in txt.split("\n")]
     self.assert_(max(lengths)  <= 80)
Exemple #5
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())
Exemple #6
0
 def test__long__with_non_ascii_username(self):
     self.record_list[0].user = "******"
     tf1 = TextFormatter(self.record_list)
     txt = tf1.long()
     assert "Erdős" in txt