Exemplo n.º 1
0
def test_value_and_subextension_forbidden(
        human_extension: r4.Extension) -> None:
    """Test an extension with a value and a subextension is forbidden."""
    with pytest.raises(pydantic.ValidationError):
        r4.Extension(
            url=URL,
            value_integer=VALUE_INTEGER,
            extension=[human_extension],
        )
Exemplo n.º 2
0
def test_multiple_values_extension_forbidden() -> None:
    """Test an extension with multiple values is forbidden."""
    with pytest.raises(pydantic.ValidationError):
        r4.Extension(url=URL,
                     value_integer=VALUE_INTEGER,
                     value_human_name=VALUE_HUMAN_NAME)
Exemplo n.º 3
0
def integer_extension() -> r4.Extension:
    """Define an extension with an integer as a fixture."""
    return r4.Extension(url=URL, value_integer=VALUE_INTEGER)
Exemplo n.º 4
0
def test_extension_with_subextensions(human_extension: r4.Extension,
                                      integer_extension: r4.Extension) -> None:
    """Test an extension with one or several subextensions but no values is valid."""
    r4.Extension(url=URL, extension=[integer_extension])
    r4.Extension(url=URL, extension=[human_extension])
    r4.Extension(url=URL, extension=[integer_extension, human_extension])
Exemplo n.º 5
0
def human_extension() -> r4.Extension:
    """Define an extension with a HumanName as a fixture."""
    return r4.Extension(url=URL, value_human_name=VALUE_HUMAN_NAME)