-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
- Loading branch information
1 parent
43f2070
commit e2b8073
Showing
1 changed file
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,9 @@ def test_binds(monkeypatch): | |
d.volumes = {"a": "b", "c": "d", "e": "f"} | ||
assert d.volume_mount_points == ["b", "d", "f"] | ||
d.volumes = {"/nfs/{username}": {"bind": "/home/{username}", "mode": "z"}} | ||
assert d.volume_binds == {"/nfs/xyz": {"bind": "/home/xyz", "mode": "z", "propagation": 'rprivate'}} | ||
assert d.volume_binds == { | ||
"/nfs/xyz": {"bind": "/home/xyz", "mode": "z", "propagation": 'rprivate'} | ||
} | ||
assert d.volume_mount_points == ["/home/xyz"] | ||
|
||
|
||
|
@@ -35,7 +37,13 @@ def test_format(label_template, spawner): | |
return "THIS IS A TEST" | ||
|
||
d.format_volume_name = test_format | ||
assert d.volume_binds == {"THIS IS A TEST": {"bind": "THIS IS A TEST", "mode": "z", "propagation": 'rprivate'}} | ||
assert d.volume_binds == { | ||
"THIS IS A TEST": { | ||
"bind": "THIS IS A TEST", | ||
"mode": "z", | ||
"propagation": 'rprivate', | ||
} | ||
} | ||
assert d.volume_mount_points == ["THIS IS A TEST"] | ||
|
||
|
||
|
@@ -46,7 +54,11 @@ def test_default_format_volume_name(monkeypatch): | |
d.user = types.SimpleNamespace(name="[email protected]") | ||
d.volumes = {"data/{username}": {"bind": "/home/{raw_username}", "mode": "z"}} | ||
assert d.volume_binds == { | ||
"data/user-40email-2ecom": {"bind": "/home/[email protected]", "mode": "z", "propagation": 'rprivate'} | ||
"data/user-40email-2ecom": { | ||
"bind": "/home/[email protected]", | ||
"mode": "z", | ||
"propagation": 'rprivate', | ||
} | ||
} | ||
assert d.volume_mount_points == ["/home/[email protected]"] | ||
|
||
|
@@ -60,7 +72,11 @@ def test_escaped_format_volume_name(monkeypatch): | |
d.volumes = {"data/{username}": {"bind": "/home/{username}", "mode": "z"}} | ||
d.format_volume_name = dockerspawner.volumenamingstrategy.escaped_format_volume_name | ||
assert d.volume_binds == { | ||
"data/user-40email-2ecom": {"bind": "/home/user-40email-2ecom", "mode": "z", "propagation": 'rprivate'} | ||
"data/user-40email-2ecom": { | ||
"bind": "/home/user-40email-2ecom", | ||
"mode": "z", | ||
"propagation": 'rprivate', | ||
} | ||
} | ||
assert d.volume_mount_points == ["/home/user-40email-2ecom"] | ||
|
||
|