Ejemplo n.º 1
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)
Ejemplo n.º 2
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)
Ejemplo n.º 3
0
def test_build_error():
    dr = Docker(registry, namespace, user, password)
    directory = mktree(DOCKER_SOURCE_TREE_BAD, START_TIME=time.ctime(START_TIME))
    name = "dockertestbad"
    version = "t%s" % START_TIME
    try:
        dr.build(directory, os.path.join(directory, "Dockerfile"), name, version, {})
    except TaskError, e:
        msg = str(e)
        assert "command 'docker build" in msg
        assert "nknown instruction: XXXFROM" in msg
Ejemplo n.º 4
0
def test_build_error():
    dr = Docker(registry, namespace, user, password)
    directory = mktree(DOCKER_SOURCE_TREE_BAD)
    name = "dockertestbad"
    version = "t%s" % START_TIME
    try:
        dr.build(directory, name, version)
    except TaskError, e:
        msg = str(e)
        assert "command failed" in msg
        assert "XXXFROM" in msg