예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
    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)
예제 #4
0
    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)