Skip to content

Commit

Permalink
Reuse the default executable path const in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLovering committed Oct 5, 2024
1 parent edcaed6 commit b58f98b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/test_nsjail.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
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

Expand All @@ -26,8 +26,6 @@ def setUp(self):
# 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])

Expand Down Expand Up @@ -549,7 +547,7 @@ def test_py_args(self):
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)

Expand Down

0 comments on commit b58f98b

Please sign in to comment.