aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_nsjail.py
diff options
context:
space:
mode:
authorGravatar ToxicKidz <[email protected]>2021-05-18 18:34:44 -0400
committerGravatar ToxicKidz <[email protected]>2021-05-18 18:34:44 -0400
commit4dfd47afed5f870bcfb09c7d5d29f4373eeac420 (patch)
tree992d5faa9cb51fcf3227c1558f1abb51a1b5541f /tests/test_nsjail.py
parentchore: Improve documentation for arguments in /eval (diff)
chore: Add tests for py_args and ns_jail args
Diffstat (limited to 'tests/test_nsjail.py')
-rw-r--r--tests/test_nsjail.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_nsjail.py b/tests/test_nsjail.py
index 46193b2..8955b4a 100644
--- a/tests/test_nsjail.py
+++ b/tests/test_nsjail.py
@@ -217,3 +217,16 @@ class NsJailTests(unittest.TestCase):
output = self.nsjail._consume_stdout(nsjail_subprocess)
self.assertEqual(output, chunk * expected_chunks)
+
+ def test_nsjail_args(self):
+ args = ("foo", "bar")
+ result = self.nsjail.python3("", nsjail_args=args)
+
+ self.assertEqual(result.args[9:11], args)
+
+ def test_py_args(self):
+ args = ("-m", "timeit")
+ result = self.nsjail.python3("", py_args=args)
+
+ self.assertEqual(result.returncode, 0)
+ self.assertEqual(result.args[-3:-1], args)