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
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
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__