diff options
author | 2022-11-22 13:07:15 -0500 | |
---|---|---|
committer | 2022-11-22 13:07:15 -0500 | |
commit | 621c835f28cd3fcd1e5c3cccae9b5057647f9fa1 (patch) | |
tree | 50d9dd6bd6bf84c8c201995adfa59ed0f1832c33 /tests | |
parent | Readded lib64 (diff) |
Fixed leading empty filter for py_args
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_nsjail.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/test_nsjail.py b/tests/test_nsjail.py index dca0a8f..da2afea 100644 --- a/tests/test_nsjail.py +++ b/tests/test_nsjail.py @@ -361,11 +361,18 @@ class NsJailTests(unittest.TestCase): self.assertEqual(result.args[end - len(args) : end], args) def test_py_args(self): - args = ["-m", "timeit"] - result = self.nsjail.python3(args) - - self.assertEqual(result.returncode, 0) - self.assertEqual(result.args[-2:], args) + expected = ["-m", "timeit"] + args = [ + ["", "-m", "timeit"], + ["", "", "-m", "timeit"], + ["", "", "", "-m", "timeit"], + ] + # Leading empty strings should be removed + for case in args: + with self.subTest(args=args): + result = self.nsjail.python3(case) + self.assertEqual(result.returncode, 0) + self.assertEqual(result.args[-2:], expected) class NsJailArgsTests(unittest.TestCase): |