Esempio n. 1
0
def test_placeholder_with_schema():
    test_schema = {
        "A": {
            "B":{
                "C": int
            }
        },
        "Request": {
            "Status": str
        },
        "Hello": float
    }
    workflow_input = ExecutionInput(schema=test_schema)
    assert workflow_input.get_schema_as_dict() == test_schema
    assert workflow_input.immutable == True

    with pytest.raises(ValueError):
        workflow_input["A"]["B"]["D"]
    
    with pytest.raises(ValueError):
        workflow_input["A"]["B"].get("C", float)
Esempio n. 2
0
def test_placeholder_schema_as_dict():
    workflow_input = ExecutionInput()
    workflow_input["A"]["b"].get("C", float)
    workflow_input["Message"]
    workflow_input["Key01"]["Key02"]
    workflow_input["Key03"]
    workflow_input["Key03"]["Key04"]

    expected_schema = {
        "A": {
            "b": {
                "C": float
            }
        },
        "Message": str,
        "Key01": {
            "Key02": str
        },
        "Key03": {
            "Key04": str
        }
    }

    assert workflow_input.get_schema_as_dict() == expected_schema