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))
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)
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)
def test_remote_exists_false(): dr = Docker("registry.hub.docker.com", "datawire", user, password) assert dr.remote_exists("forge-setup-test", "1")
def test_remote_exists_true(): dr = Docker(registry, namespace, user, password) assert not dr.remote_exists("nosuchrepo", "nosuchversion")