mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-11 20:12:58 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
@@ -188,15 +188,16 @@ def test_group_add(container, tmpdir):
|
|||||||
logs = c.logs(stdout=True).decode("utf-8")
|
logs = c.logs(stdout=True).decode("utf-8")
|
||||||
assert "uid=1010 gid=1010 groups=1010,100(users)" in logs
|
assert "uid=1010 gid=1010 groups=1010,100(users)" in logs
|
||||||
|
|
||||||
|
|
||||||
def test_container_not_delete_bind_mount(container, tmp_path):
|
def test_container_not_delete_bind_mount(container, tmp_path):
|
||||||
"""Container should not delete host system files when using the (docker)
|
"""Container should not delete host system files when using the (docker)
|
||||||
-v bind mount flag and mapping to /home/jovyan.
|
-v bind mount flag and mapping to /home/jovyan.
|
||||||
"""
|
"""
|
||||||
d = tmp_path / "data"
|
d = tmp_path / "data"
|
||||||
d.mkdir()
|
d.mkdir()
|
||||||
p = d / "foo.txt"
|
p = d / "foo.txt"
|
||||||
p.write_text("some-content")
|
p.write_text("some-content")
|
||||||
|
|
||||||
c = container.run(
|
c = container.run(
|
||||||
tty=True,
|
tty=True,
|
||||||
user="root",
|
user="root",
|
||||||
@@ -205,11 +206,11 @@ def test_container_not_delete_bind_mount(container, tmp_path):
|
|||||||
"NB_USER=user",
|
"NB_USER=user",
|
||||||
"CHOWN_HOME=yes",
|
"CHOWN_HOME=yes",
|
||||||
],
|
],
|
||||||
volumes={ d : {'bind': '/home/jovyan/data', 'mode': 'rw'}},
|
volumes={d: {"bind": "/home/jovyan/data", "mode": "rw"}},
|
||||||
command=["start.sh", "jupyter", "lab"]
|
command=["start.sh", "jupyter", "lab"],
|
||||||
)
|
)
|
||||||
|
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
assert p.read_text() == "some-content"
|
assert p.read_text() == "some-content"
|
||||||
assert len(list(tmp_path.iterdir())) == 1
|
assert len(list(tmp_path.iterdir())) == 1
|
||||||
|
Reference in New Issue
Block a user