def _read_tokens(filename, start, end): with open(filename, 'r') as file: content = file.readlines() lines = content[start:end] tokens = [] for line in lines: tokens.append(Token.load_xml(line.strip())) return tokens
def test_load_xml(self): string = '<integerConstant>30</integerConstant>' token = Token.load_xml(string) self.assertEqual(token.to_xml(), string)