示例#1
0
文件: __init__.py 项目: bbonf/matcha
    def test_no_arguments(self):
        p = invocation()
        node, r = p('module.func()')

        eq_(r, '')
        assert_is_instance(node, Invocation)
        eq_(node.func, Symbol('module.func'))
        eq_(node.args, [])
示例#2
0
文件: __init__.py 项目: bbonf/matcha
    def test_simple(self):
        p = invocation()
        node, r = p('module.func(symbol, 123,"string")')

        eq_(r, '')
        assert_is_instance(node, Invocation)
        eq_(node.func, Symbol('module.func'))
        eq_(node.args[0], Symbol('symbol'))
        eq_(node.args[1], NumericLiteral('123'))
        eq_(node.args[2], StringLiteral('"string"'))