예제 #1
0
def test_bitbucket_empty_serialize():
    # Testing that empty serialization occurs without error or weirdness in attributes.
    bitbucket = storage.Bitbucket(project="PROJECT", repo="test-repo")
    serialized = BitbucketSchema().dump(bitbucket)
    assert serialized["__version__"] == prefect.__version__
    assert serialized["project"] == "PROJECT"
    assert serialized["repo"] == "test-repo"
    assert not serialized["host"]
    assert not serialized["path"]
    assert not serialized["ref"]
    assert serialized["secrets"] == []
예제 #2
0
def test_bitbucket_full_serialize():
    bitbucket = storage.Bitbucket(
        project="PROJECT",
        repo="test-repo",
        path="test-flow.py",
        host="http://localhost:7990",
        ref="develop",
        secrets=["token"],
    )

    serialized = BitbucketSchema().dump(bitbucket)
    assert serialized["__version__"] == prefect.__version__
    assert serialized["project"] == "PROJECT"
    assert serialized["repo"] == "test-repo"
    assert serialized["path"] == "test-flow.py"
    assert serialized["host"] == "http://localhost:7990"
    assert serialized["ref"] == "develop"
    assert serialized["secrets"] == ["token"]