def test_function_call(function_call): validate_uncompyle(function_call)
def test_function_no_args(): validate_uncompyle("fn()")
def test_BUILD_TUPLE_BUILD_TUPLE_UNPACK_WITH_CALL_CALL_FUNCTION_EX(): validate_uncompyle("fn(*c,v)")
def test_BUILD_CONST_KEY_MAP_CALL_FUNCTION_EX(): validate_uncompyle("fn(i=0,y=0,*p)")
def test_BUILD_TUPLE_CALL_FUNCTION_EX(): validate_uncompyle("fn(**a)")
def test_BUILD_MAP_BUILD_TUPLE_BUILD_TUPLE_UNPACK_WITH_CALL_CALL_FUNCTION_EX( ): validate_uncompyle("fn(b,b,b=0,*a)")
def test_CALL_FUNCTION_EX(): validate_uncompyle("fn(*g,**j)")
def test_CALL_FUNCTION_KW(): validate_uncompyle("fn(j=0)")
def test_BUILD_CONST_KEY_MAP_BUILD_MAP_UNPACK_WITH_CALL_BUILD_TUPLE_CALL_FUNCTION_EX( ): validate_uncompyle("fn(w=0,m=0,**v)")
def test_BUILD_MAP_BUILD_MAP_UNPACK_WITH_CALL_BUILD_TUPLE_CALL_FUNCTION_EX( ): validate_uncompyle("fn(a=0,**g)")
def test_function_call_double_star_only(expr): validate_uncompyle(expr)
def test_function_call_keyword_only(expr): validate_uncompyle(expr)
def test_function_positional_only(expr): validate_uncompyle(expr)
import pytest # decompyle3 from validate import validate_uncompyle TESTS = ( "{0.: 'a', -1: 'b'}", # BUILD_MAP "{'a':'b'}", # BUILD_MAP "{0: 1}", # BUILD_MAP "{b'0':1, b'2':3}", # BUILD_CONST_KEY_MAP "{0: 1, 2: 3}", # BUILD_CONST_KEY_MAP "{'a':'b','c':'d'}", # BUILD_CONST_KEY_MAP "{0: 1, 2: 3}", # BUILD_CONST_KEY_MAP "{'a': 1, 'b': 2}", # BUILD_CONST_KEY_MAP "{'a':'b','c':'d'}", # BUILD_CONST_KEY_MAP "{0.0:'b',0.1:'d'}", # BUILD_CONST_KEY_MAP ) @pytest.mark.parametrize("text", TESTS) def test_build_const_key_map(text): validate_uncompyle(text) if __name__ == "__main__": for test in TESTS: validate_uncompyle(test)
def test_BUILD_MAP_CALL_FUNCTION_EX(): validate_uncompyle("fn(*z,u=0)")
def test_build_const_key_map(text): validate_uncompyle(text)
def test_CALL_FUNCTION(): validate_uncompyle("fn(w,m,f)")