kopia lustrzana https://github.com/jupyterhub/repo2docker
Set base_image in a few more places
rodzic
b58fd1508d
commit
7eb143eab0
|
@ -12,7 +12,7 @@ from repo2docker.buildpacks import (
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_cache_from_base(tmpdir):
|
def test_cache_from_base(tmpdir, base_image):
|
||||||
cache_from = ["image-1:latest"]
|
cache_from = ["image-1:latest"]
|
||||||
fake_log_value = {"stream": "fake"}
|
fake_log_value = {"stream": "fake"}
|
||||||
fake_client = MagicMock(spec=docker.APIClient)
|
fake_client = MagicMock(spec=docker.APIClient)
|
||||||
|
@ -21,7 +21,7 @@ def test_cache_from_base(tmpdir):
|
||||||
|
|
||||||
# Test base image build pack
|
# Test base image build pack
|
||||||
tmpdir.chdir()
|
tmpdir.chdir()
|
||||||
for line in BaseImage().build(
|
for line in BaseImage(base_image).build(
|
||||||
fake_client, "image-2", 100, {}, cache_from, extra_build_kwargs
|
fake_client, "image-2", 100, {}, cache_from, extra_build_kwargs
|
||||||
):
|
):
|
||||||
assert line == fake_log_value
|
assert line == fake_log_value
|
||||||
|
|
|
@ -13,7 +13,7 @@ from repo2docker.buildpacks import BaseImage, DockerBuildPack
|
||||||
basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
|
|
||||||
def test_memory_limit_enforced(tmpdir):
|
def test_memory_limit_enforced(tmpdir, base_image):
|
||||||
fake_cache_from = ["image-1:latest"]
|
fake_cache_from = ["image-1:latest"]
|
||||||
fake_log_value = {"stream": "fake"}
|
fake_log_value = {"stream": "fake"}
|
||||||
fake_client = MagicMock(spec=docker.APIClient)
|
fake_client = MagicMock(spec=docker.APIClient)
|
||||||
|
@ -27,7 +27,7 @@ def test_memory_limit_enforced(tmpdir):
|
||||||
# Test that the buildpack passes the right arguments to the docker
|
# Test that the buildpack passes the right arguments to the docker
|
||||||
# client in order to enforce the memory limit
|
# client in order to enforce the memory limit
|
||||||
tmpdir.chdir()
|
tmpdir.chdir()
|
||||||
for line in BaseImage().build(
|
for line in BaseImage(base_image).build(
|
||||||
fake_client,
|
fake_client,
|
||||||
"image-2",
|
"image-2",
|
||||||
memory_limit,
|
memory_limit,
|
||||||
|
|
Ładowanie…
Reference in New Issue