def test_normal(self): moves = MovesFile({'-i': os.path.join(ROOT, 'normal.dat')}) moves_list = list(moves.parse()) self.assertEqual(4, len(moves_list))
def test_empty_line_missing(self): moves = MovesFile({'-i': os.path.join(ROOT, 'empty_line_missing.dat')}) moves_list = list(moves.parse()) self.assertEqual(4, len(moves_list))
def test_too_many_lines_between(self): moves = MovesFile( {'-i': os.path.join(ROOT, 'too_many_lines_between.dat')}) moves_list = list(moves.parse()) self.assertEqual(4, len(moves_list))
def test_file_not_exist(self): with self.assertRaises(FileNotFoundError): MovesFile({'-i': os.path.join(ROOT, 'idonotexist')})