Пример #1
0
    def test_compile_empty_function(self):
        ast1 = parser.suite('def f(): pass')
        ast2 = cpy_parser.suite('def f(): pass')
    
        tup1 = parser.ast2tuple(ast1)
        tup2 = cpy_parser.ast2tuple(ast2)

        self.assertEquals(tup1, tup2)
Пример #2
0
    def test_compile_function(self):
        source = "def f(x, arg1=None): return x"
        ast1 = parser.suite(source)
        ast2 = cpy_parser.suite(source)
    
        tup1 = parser.ast2tuple(ast1)
        tup2 = cpy_parser.ast2tuple(ast2)

        self.assertEquals(tup1, tup2)