From e7019bf300b0c5eca64d6c4ebabe52c88f1d0375 Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Tue, 21 Dec 2021 09:31:50 -0800 Subject: Fix NsJail args test Dynamically calculate the position of the arguments rather than hard-coding them. --- tests/test_nsjail.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/test_nsjail.py') 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") -- cgit v1.2.3