コード例 #1
0
def test_optional_text_property(id_name, optional):
    result = text_property({"id": id_name, "optional": optional})
    assert result == {
        id_name: {
            "type": "string",
            "minLength": 0 if optional else 1
        }
    }
コード例 #2
0
def test_text_property_format(id_name):
    result = text_property({"id": id_name, "limits": {"format": "email"}})
    assert result == {
        id_name: {
            "type": "string",
            "format": "email",
            "minLength": 1
        }
    }
コード例 #3
0
def test_text_property_format(id_name):
    result = text_property({"id": id_name, "limits": {"format": "email"}})
    assert result == {
        id_name: {
            "type": "string",
            "format": "email",
            "minLength": 1,
            "pattern": EMAIL_PATTERN
        }
    }
コード例 #4
0
def test_text_property(id_name):
    result = text_property({"id": id_name})
    assert result == {id_name: {"type": "string", "minLength": 1}}
コード例 #5
0
def test_optional_text_property(id_name, optional):
    result = text_property({"id": id_name, "optional": optional})
    assert result == {id_name: {"type": "string", "minLength": 0 if optional else 1}}
コード例 #6
0
def test_text_property(id_name):
    result = text_property({"id": id_name})
    assert result == {id_name: {"type": "string", "minLength": 1}}