mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-04 15:28:40 +00:00
test_control_install: the ".." escape test climbs to a real setup.py again, and asserts it is there
The refused command that climbs out of metal/tools with ".." named engine/setup.py after the layout move, a file that does not exist, so the test refused a missing file instead of the climb (before the move the same path was the repository's setup.py). It now climbs three levels to terminal/setup.py and the test asserts that file exists first.
This commit is contained in:
1 parent
6a3ddb731b
commit
44d4a006a7
1 file changed
+4
-1
@@ -81,13 +81,16 @@ class ControlModeTests(unittest.TestCase):
|
||||
with self.subTest(allowed=tool), mock.patch.object(S.subprocess, "run", return_value=done) as runner:
|
||||
S.run([sys.executable, str(ROOT.parent / "engine" / "metal" / "tools" / tool), "--help"], check=False)
|
||||
runner.assert_called_once()
|
||||
# a ".." climb out of metal/tools to a REAL setup.py (the Terminal's, since the 0.2.16 layout): refused for the climb, not for a missing file
|
||||
escape = ROOT.parent / "engine" / "metal" / "tools" / ".." / ".." / ".." / "terminal" / "setup.py"
|
||||
self.assertTrue(escape.resolve().is_file(), escape)
|
||||
for refused in (
|
||||
[sys.executable, "-m", "metal.tools.metal_repack"], # -m is never allowed
|
||||
["python3", str(ROOT.parent / "engine" / "metal" / "tools" / "metal_repack.py")], # another interpreter
|
||||
[sys.executable, str(ROOT.parent / "engine" / "metal" / "kernels" / "evil.py")], # another folder of the bundle
|
||||
[sys.executable, str(ROOT.parent / "engine" / "metal" / "evil.py")], # metal/ itself
|
||||
[sys.executable, str(self.home / "metal" / "tools" / "metal_repack.py")], # a copy in the install folder
|
||||
[sys.executable, str(ROOT.parent / "engine" / "metal" / "tools" / ".." / ".." / "setup.py")],
|
||||
[sys.executable, str(escape)],
|
||||
[sys.executable],
|
||||
):
|
||||
with self.subTest(refused=refused), mock.patch.object(S.subprocess, "run", side_effect=AssertionError("ran")):
|
||||
|
||||
Reference in new issue
Block a user