Skip to content

Commit b94c2f2

Browse files
authored
Merge pull request #1467 from twalcari/patch-4
Add test for copying of hidden folder
2 parents 4a6a153 + 7494214 commit b94c2f2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

base-notebook/test/test_container_options.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ def test_nb_user_change(container):
9595
output == expected_output
9696
), f"Bad owner for the {nb_user} home folder {output}, expected {expected_output}"
9797

98+
LOGGER.info(
99+
f"Checking if home folder of {nb_user} contains the hidden '.jupyter' folder with appropriate permissions ..."
100+
)
101+
command = f'stat -c "%F %U %G" /home/{nb_user}/.jupyter'
102+
expected_output = f"directory {nb_user} users"
103+
cmd = running_container.exec_run(command, workdir=f"/home/{nb_user}")
104+
output = cmd.output.decode("utf-8").strip("\n")
105+
assert (
106+
output == expected_output
107+
), f"Hidden folder .jupyter was not copied properly to {nb_user} home folder. stat: {output}, expected {expected_output}"
108+
98109

99110
def test_chown_extra(container):
100111
"""Container should change the UID/GID of CHOWN_EXTRA."""

0 commit comments

Comments
 (0)