def test_first_matrix_fetched_correctly(self): """ Test for a drawlog of a 2d celldevs for only 1 drawing with only 0's in the matrix""" drawlog_path = simplestDrawlogPath() file_parser = CDevsFileParser(drawlog_path) matrices = file_parser.onlyMatrices() first_matrix_lines = next(matrices).splitlines() correct_lines = simplestMatrixStr().splitlines() for res,correct in zip(first_matrix_lines,correct_lines): self.assertEqual(res,correct)
def test_first_and_matrix_fetched_correctly(self): """ Test for a drawlog of a 2d celldevs for 2 times """ drawlog_path = twoTimesDrawlogPath() first_matrix = twoTimesDrwFirstMatrix() second_matrix = twoTimesDrwSecondMatrix() file_parser = CDevsFileParser(drawlog_path) matrices = file_parser.onlyMatrices() first_matrix_lines = next(matrices).splitlines() first_matrix_correct_lines = twoTimesDrwFirstMatrix().splitlines() for res,correct in zip(first_matrix_lines,first_matrix_correct_lines): self.assertEqual(res,correct) second_matrix_lines = next(matrices).splitlines() second_matrix_correct_lines = twoTimesDrwSecondMatrix().splitlines() for res,correct in zip(second_matrix_lines,second_matrix_correct_lines): self.assertEqual(res,correct)