class LogLineBlockTest(unittest.TestCase): def setUp(self): self.obj = LogLineBlock() def test_can_take_initial_list_of_lines(self): obj = LogLineBlock([TIME_STEP_START_LINE]) self.assertEqual(len(obj.lines), 1) def test_can_append_new_lines(self): self.assertEqual(len(self.obj.lines), 0) self.obj.append_line(TIME_STEP_START_LINE) self.assertEqual(len(self.obj.lines), 1) def test_denies_non_log_lines(self): with self.assertRaises(ValueError): self.obj.append_line('not a log line') def test_has_prop_lines(self): self.assertIsInstance(self.obj.lines, list)
def setUp(self): self.obj = LogLineBlock()