예제 #1
0
def test_passStructsInVariadic():
    output = StructPassing.how_many_var_args_did_i_pass(
        123, TopLevelStruct(required='hello', second_level=1),
        TopLevelStruct(
            required='bye',
            second_level=SecondLevelStruct(deeper_required_prop='ciao')))
    assert output == 2
예제 #2
0
def test_passStructsInVariadic():
    output = StructPassing.how_many_var_args_did_i_pass(
        123,
        TopLevelStruct(required="hello", second_level=1),
        TopLevelStruct(
            required="bye", second_level=SecondLevelStruct(deeper_required_prop="ciao")
        ),
    )
    assert output == 2
예제 #3
0
def test_structEquality():
    a = TopLevelStruct(required='bye', second_level=SecondLevelStruct(deeper_required_prop='ciao'))
    b = TopLevelStruct(required='hello', second_level=1),
    c = TopLevelStruct(required='hello', second_level=1),
    d = SecondLevelStruct(deeper_required_prop='exists')

    assert a != b
    assert b == c
    assert a != 5
    assert a != d
예제 #4
0
def test_structEquality():
    a = TopLevelStruct(
        required="bye", second_level=SecondLevelStruct(deeper_required_prop="ciao")
    )
    b = (TopLevelStruct(required="hello", second_level=1),)
    c = (TopLevelStruct(required="hello", second_level=1),)
    d = SecondLevelStruct(deeper_required_prop="exists")

    assert a != b
    assert b == c
    assert a != 5
    assert a != d