def test_token_error(self): token = Mock() token.value = 'unknown' token.lexer = Mock() token.lexer.lineno = 10 self.assertRaises(LingoLexingException, self.parser.t_error, token)
def test_production_error(self): production = Mock() production.lexer = Mock() production.lexer.lexdata = 'hello\nworld' production.lexpos = 0 production.lineno = 1 self.assertRaises(LingoParsingException, self.parser.p_error, production)