aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ionite34 <[email protected]>2022-11-28 09:38:01 +0800
committerGravatar ionite34 <[email protected]>2022-11-28 09:38:01 +0800
commitfca97cecea5040dac8ab02046cffac0713f78dd2 (patch)
tree9ac06c1752edd05ae536ed54170abbea74b4a034
parentAdd additional tests for py_args (diff)
Switch null byte test to use eval_code
-rw-r--r--tests/test_nsjail.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/test_nsjail.py b/tests/test_nsjail.py
index 9f99465..ccbca56 100644
--- a/tests/test_nsjail.py
+++ b/tests/test_nsjail.py
@@ -229,9 +229,8 @@ class NsJailTests(unittest.TestCase):
self.assertEqual(result.stderr, None)
def test_null_byte_value_error(self):
- # This error does not occur without -c, where it
- # would be a normal SyntaxError.
- result = self.nsjail.python3(["-c", "\0"])
+ # This error only occurs with `-c` mode
+ result = self.eval_code("\0")
self.assertEqual(result.returncode, None)
self.assertEqual(result.stdout, "ValueError: embedded null byte")
self.assertEqual(result.stderr, None)