aboutsummaryrefslogtreecommitdiffstats
path: root/tests/api/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/api/__init__.py')
-rw-r--r--tests/api/__init__.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/api/__init__.py b/tests/api/__init__.py
new file mode 100644
index 0000000..dcee5b5
--- /dev/null
+++ b/tests/api/__init__.py
@@ -0,0 +1,23 @@
+from subprocess import CompletedProcess
+from unittest import mock
+
+from falcon import testing
+
+from snekbox.api import SnekAPI
+
+
+class SnekAPITestCase(testing.TestCase):
+ def setUp(self):
+ super().setUp()
+
+ 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 = CompletedProcess(
+ args=[],
+ returncode=0,
+ stdout="output",
+ stderr="error"
+ )
+ self.addCleanup(self.patcher.stop)
+
+ self.app = SnekAPI()