コード例 #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
ファイル: test_storage.py プロジェクト: tank0226/prefect
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")