Пример #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
        }
    }
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}}
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}}
def test_text_property(id_name):
    result = text_property({"id": id_name})
    assert result == {id_name: {"type": "string", "minLength": 1}}