Пример #1
0
 def test_function_call(function_call):
     validate_uncompyle(function_call)
Пример #2
0
 def test_function_no_args():
     validate_uncompyle("fn()")
Пример #3
0
 def test_BUILD_TUPLE_BUILD_TUPLE_UNPACK_WITH_CALL_CALL_FUNCTION_EX():
     validate_uncompyle("fn(*c,v)")
Пример #4
0
 def test_BUILD_CONST_KEY_MAP_CALL_FUNCTION_EX():
     validate_uncompyle("fn(i=0,y=0,*p)")
Пример #5
0
 def test_BUILD_TUPLE_CALL_FUNCTION_EX():
     validate_uncompyle("fn(**a)")
Пример #6
0
 def test_BUILD_MAP_BUILD_TUPLE_BUILD_TUPLE_UNPACK_WITH_CALL_CALL_FUNCTION_EX(
 ):
     validate_uncompyle("fn(b,b,b=0,*a)")
Пример #7
0
 def test_CALL_FUNCTION_EX():
     validate_uncompyle("fn(*g,**j)")
def test_CALL_FUNCTION_KW():
    validate_uncompyle("fn(j=0)")
Пример #9
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)")
Пример #10
0
 def test_BUILD_MAP_BUILD_MAP_UNPACK_WITH_CALL_BUILD_TUPLE_CALL_FUNCTION_EX(
 ):
     validate_uncompyle("fn(a=0,**g)")
Пример #11
0
 def test_function_call_double_star_only(expr):
     validate_uncompyle(expr)
Пример #12
0
 def test_function_call_keyword_only(expr):
     validate_uncompyle(expr)
Пример #13
0
 def test_function_positional_only(expr):
     validate_uncompyle(expr)
Пример #14
0
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)
Пример #15
0
 def test_BUILD_MAP_CALL_FUNCTION_EX():
     validate_uncompyle("fn(*z,u=0)")
Пример #16
0
def test_build_const_key_map(text):
    validate_uncompyle(text)
def test_CALL_FUNCTION():
    validate_uncompyle("fn(w,m,f)")