diff options
author | 2020-11-21 00:19:42 +0100 | |
---|---|---|
committer | 2020-11-21 00:21:52 +0100 | |
commit | faa8fe73d8c197df79774c67211f144238717f58 (patch) | |
tree | 1bd996d7544e66a3562738398cad5bb9ff2a2721 /tests | |
parent | Add test for stdout output truncation (diff) |
Move exit code conversion to main function
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_nsjail.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/test_nsjail.py b/tests/test_nsjail.py index f4e678c..40c27f9 100644 --- a/tests/test_nsjail.py +++ b/tests/test_nsjail.py @@ -5,7 +5,7 @@ import unittest import unittest.mock from textwrap import dedent -from snekbox.nsjail import MEM_MAX, NsJail, READ_CHUNK_SIZE, OUTPUT_MAX +from snekbox.nsjail import MEM_MAX, NsJail, OUTPUT_MAX, READ_CHUNK_SIZE class NsJailTests(unittest.TestCase): @@ -195,9 +195,7 @@ class NsJailTests(unittest.TestCase): # Go 10 chunks over to make sure we exceed the limit nsjail_subprocess.stdout = io.StringIO((expected_chunks + 10) * chunk) - nsjail_subprocess.returncode = -9 nsjail_subprocess.poll.return_value = None - returncode, output = self.nsjail._consume_stdout(nsjail_subprocess) - self.assertEqual(returncode, 137) + output = self.nsjail._consume_stdout(nsjail_subprocess) self.assertEqual(output, chunk * expected_chunks) |