aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_nsjail.py
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2021-12-21 09:31:50 -0800
committerGravatar MarkKoz <[email protected]>2021-12-21 09:31:50 -0800
commite7019bf300b0c5eca64d6c4ebabe52c88f1d0375 (patch)
tree8261f3b308c652b1575a70baea34acfc120bc8f8 /tests/test_nsjail.py
parentSet the max swap size through NsJail (diff)
Fix NsJail args test
Dynamically calculate the position of the arguments rather than hard-coding them.
Diffstat (limited to 'tests/test_nsjail.py')
-rw-r--r--tests/test_nsjail.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test_nsjail.py b/tests/test_nsjail.py
index c0ed96b..989cc31 100644
--- a/tests/test_nsjail.py
+++ b/tests/test_nsjail.py
@@ -259,7 +259,8 @@ class NsJailTests(unittest.TestCase):
args = ("foo", "bar")
result = self.nsjail.python3("", nsjail_args=args)
- self.assertEqual(result.args[9:11], args)
+ end = result.args.index("--")
+ self.assertEqual(result.args[end - len(args):end], args)
def test_py_args(self):
args = ("-m", "timeit")