aboutsummaryrefslogtreecommitdiffstats
path: root/tests/api/__init__.py
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2019-06-09 23:22:04 +0200
committerGravatar GitHub <[email protected]>2019-06-09 23:22:04 +0200
commit803d96c9a7f8b2d80b3f9b10d35ceb6440fa431e (patch)
treeada556ca7e1aff5e650afe58139bc20d3d47dfc0 /tests/api/__init__.py
parentMerge pull request #23 from python-discord/falcon (diff)
parentRespond to eval with stdout, stderr, and the return code (diff)
Merge pull request #24 from python-discord/refactor/nsjail
Improve NsJail
Diffstat (limited to 'tests/api/__init__.py')
-rw-r--r--tests/api/__init__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/api/__init__.py b/tests/api/__init__.py
index fd4679a..dcee5b5 100644
--- a/tests/api/__init__.py
+++ b/tests/api/__init__.py
@@ -1,3 +1,4 @@
+from subprocess import CompletedProcess
from unittest import mock
from falcon import testing
@@ -11,7 +12,12 @@ class SnekAPITestCase(testing.TestCase):
self.patcher = mock.patch("snekbox.api.resources.eval.NsJail", autospec=True)
self.mock_nsjail = self.patcher.start()
- self.mock_nsjail.return_value.python3.return_value = "test output"
+ self.mock_nsjail.return_value.python3.return_value = CompletedProcess(
+ args=[],
+ returncode=0,
+ stdout="output",
+ stderr="error"
+ )
self.addCleanup(self.patcher.stop)
self.app = SnekAPI()