예제 #1
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"],
    )
예제 #2
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"] == []
예제 #3
0
def test_bitbucket_incorrect_secret():
    with pytest.raises(ValueError):
        storage.Bitbucket(
            project="PROJECT",
            repo="test-repo",
            workspace="test-workspace",
            path="test-flow.py",
            host="http://localhost:7990",
            ref="develop",
            secrets=["token"],
            access_token_secret="secret",
        )
예제 #4
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"]
예제 #5
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")