コード例 #1
0
ファイル: test_docker.py プロジェクト: aj0415/cforge
def test_remote_exists_auth_failed():
    dr = Docker(registry, "forgetest", "nosuchuser", "badpassword")
    try:
        dr.remote_exists("nonexistent", "nosuchversion")
    except TaskError, e:
        assert ("problem authenticating" in str(e)) or ("unauthorized"
                                                        in str(e))
コード例 #2
0
def test_build_push():
    dr = Docker(registry, namespace, user, password)
    directory = mktree(DOCKER_SOURCE_TREE, START_TIME=time.ctime(START_TIME))
    name = "dockertest"
    version = "t%s" % START_TIME
    dr.build(directory, os.path.join(directory, "Dockerfile"), name, version, {})
    dr.push(name, version)
    assert dr.remote_exists(name, version)
コード例 #3
0
def test_build_push():
    dr = Docker(registry, namespace, user, password)
    directory = mktree(DOCKER_SOURCE_TREE)
    name = "dockertest"
    version = "t%s" % START_TIME
    dr.build(directory, name, version)
    dr.push(name, version)
    assert dr.remote_exists(name, version)
コード例 #4
0
def test_remote_exists_false():
    dr = Docker("registry.hub.docker.com", "datawire", user, password)
    assert dr.remote_exists("forge-setup-test", "1")
コード例 #5
0
def test_remote_exists_true():
    dr = Docker(registry, namespace, user, password)
    assert not dr.remote_exists("nosuchrepo", "nosuchversion")