Example #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"
        }
    }
Example #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
    }
Example #3
0
def test_parameter_default():
    p = Parameter(name="x")
    assert p.to_dict() == {"name": "x", "description": "x", "schema": {}}