Exemplo n.º 1
0
def test_static_parameters_union_1():
    sp1 = {
        "headers": {
            "header1": "example1 string"
        },
        "body": {
            "foo1": "example1 string"
        }
    }
    sp2 = {
        "headers": {
            "header2": "example2 string"
        },
        "body": {
            "foo2": "example2 string"
        }
    }

    full_sp1, full_sp2 = examples.static_parameters_union(sp1, sp2)
    assert "header1" in full_sp1["headers"] and full_sp1["headers"][
        "header1"] == "example1 string"
    assert "header2" in full_sp1["headers"] and full_sp1["headers"][
        "header2"] == "example2 string"
    assert "header1" in full_sp2["headers"] and full_sp2["headers"][
        "header1"] == "example1 string"
    assert "header2" in full_sp2["headers"] and full_sp2["headers"][
        "header2"] == "example2 string"

    assert full_sp1["body"] == {"foo1": "example1 string"}
    assert full_sp2["body"] == {"foo2": "example2 string"}
Exemplo n.º 2
0
def test_static_parameters_union_0():
    sp1 = {"headers": {"header1": "example1 string"}, "body": {"foo1": "example1 string"}}
    sp2 = {}

    full_sp = examples.static_parameters_union(sp1, sp2)
    full_sp1 = full_sp[0]
    assert len(full_sp) == 1
    assert "header1" in full_sp1["headers"] and full_sp1["headers"]["header1"] == "example1 string"
    assert full_sp1["body"] == {"foo1": "example1 string"}