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