예제 #1
0
def test_parameter_schema_str():
    p = Parameter(name="x", description="the x value.", schema="number")
    assert p.to_dict() == {
        "name": "x",
        "description": "the x value.",
        "schema": {
            "type": "number"
        }
    }
예제 #2
0
def test_parameter_schema_default_none():
    p = Parameter(name="x",
                  description="the x value.",
                  schema="number",
                  default=None)
    assert p.to_dict() == {
        "name": "x",
        "description": "the x value.",
        "schema": {
            "type": "number"
        },
        "optional": True,
        "default": None
    }
예제 #3
0
def test_parameter_default():
    p = Parameter(name="x")
    assert p.to_dict() == {"name": "x", "description": "x", "schema": {}}