diff options
author | 2024-10-05 09:56:09 +0100 | |
---|---|---|
committer | 2024-10-05 09:56:09 +0100 | |
commit | b58f98bd5127cac43cba4dcff66f9d7a01527576 (patch) | |
tree | 217dbd873994e062d61a0262bf1b46581db7a83c /tests/test_nsjail.py | |
parent | Use 'executable' over 'binary' to be clearer as to what is supported (diff) |
Reuse the default executable path const in tests
Diffstat (limited to 'tests/test_nsjail.py')
-rw-r--r-- | tests/test_nsjail.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/test_nsjail.py b/tests/test_nsjail.py index a3f1312..6764f1e 100644 --- a/tests/test_nsjail.py +++ b/tests/test_nsjail.py @@ -9,7 +9,7 @@ from itertools import product from pathlib import Path from textwrap import dedent -from snekbox.nsjail import NsJail +from snekbox.nsjail import DEFAULT_EXECUTABLE_PATH, NsJail from snekbox.snekio import FileAttachment from snekbox.snekio.filesystem import Size @@ -26,8 +26,6 @@ class NsJailTests(unittest.TestCase): # Hard-coded because it's non-trivial to parse the mount options. self.shm_mount_size = 40 * Size.MiB - self.default_binary_path = "/snekbin/python/default/bin/python" - def eval_code(self, code: str): return self.nsjail.python3(["-c", code]) @@ -549,7 +547,7 @@ class NsJailTests(unittest.TestCase): for args, expected in cases: with self.subTest(args=args): result = self.nsjail.python3(py_args=args) - idx = result.args.index(self.default_binary_path) + idx = result.args.index(DEFAULT_EXECUTABLE_PATH) self.assertEqual(result.args[idx + 1 :], expected) self.assertEqual(result.returncode, 0) |