Пример #1
0
def test_deserialize_docker_environment():
    env = environments.DockerEnvironment(
        base_image="a", python_dependencies=["b", "c"], registry_url="f"
    )
    serialized = DockerEnvironmentSchema().dump(env)
    deserialized = DockerEnvironmentSchema().load(serialized)

    assert deserialized.base_image == env.base_image
    assert deserialized.registry_url == env.registry_url
Пример #2
0
def test_environment_schema_with_docker_environment():
    env = environments.DockerEnvironment(
        base_image="a", python_dependencies=["b", "c"], registry_url="f"
    )
    serialized = EnvironmentSchema().dump(env)
    deserialized = EnvironmentSchema().load(serialized)
    assert isinstance(deserialized, environments.DockerEnvironment)
    assert deserialized.registry_url == env.registry_url
    assert deserialized.base_image == env.base_image
Пример #3
0
def test_serialize_docker_environment():
    env = environments.DockerEnvironment(
        base_image="a",
        python_dependencies=["b", "c"],
        registry_url="f",
        image_name="g",
        image_tag="h",
    )
    serialized = DockerEnvironmentSchema().dump(env)
    assert serialized["base_image"] == "a"
    assert serialized["registry_url"] == "f"
    assert serialized["image_name"] == "g"
    assert serialized["image_tag"] == "h"
    assert serialized["__version__"] == prefect.__version__