示例#1
0
def test_serialize_base_environment():
    env = environments.Environment()

    serialized = BaseEnvironmentSchema().dump(env)
    assert serialized
    assert serialized["__version__"] == prefect.__version__
    assert serialized["labels"] == []
示例#2
0
def test_serialize_base_environment_with_labels():
    env = environments.Environment(labels=["b", "c", "a"])

    serialized = BaseEnvironmentSchema().dump(env)
    assert serialized
    assert serialized["__version__"] == prefect.__version__
    assert serialized["labels"] == ["a", "b", "c"]
示例#3
0
    serialized = BaseEnvironmentSchema().dump(env)
    assert serialized
    assert serialized["__version__"] == prefect.__version__
    assert serialized["labels"] == []
    assert serialized["metadata"] == {}


def test_serialize_base_environment_with_labels():
<<<<<<< HEAD
    env = environments.Environment(labels=["b", "c", "a"])
=======
    env = environments.Environment(labels=["foo", "bar"])
>>>>>>> prefect clone

    serialized = BaseEnvironmentSchema().dump(env)
    assert serialized
    assert serialized["__version__"] == prefect.__version__
<<<<<<< HEAD
    assert serialized["labels"] == ["a", "b", "c"]
=======
    assert set(serialized["labels"]) == set(["foo", "bar"])
>>>>>>> prefect clone


def test_serialize_dask_environment():
    env = environments.DaskKubernetesEnvironment()

    schema = DaskKubernetesEnvironmentSchema()
    serialized = schema.dump(env)
    assert serialized