From c24785d488e3fefeff50bc79b0fd262d09c3043a Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Mon, 9 Oct 2023 22:17:54 +0100 Subject: Allow setting a binary_path when calling /eval --- tests/test_nsjail.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/test_nsjail.py') diff --git a/tests/test_nsjail.py b/tests/test_nsjail.py index dde20bc..2d21ad3 100644 --- a/tests/test_nsjail.py +++ b/tests/test_nsjail.py @@ -26,6 +26,8 @@ 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 = "/lang/python/default/bin/python" + def eval_code(self, code: str): return self.nsjail.python3(["-c", code]) @@ -547,7 +549,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.nsjail.config.exec_bin.path) + idx = result.args.index(self.default_binary_path) self.assertEqual(result.args[idx + 1 :], expected) self.assertEqual(result.returncode, 0) -- cgit v1.2.3