diff options
Diffstat (limited to 'tests/api/__init__.py')
-rw-r--r-- | tests/api/__init__.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/api/__init__.py b/tests/api/__init__.py new file mode 100644 index 0000000..745519d --- /dev/null +++ b/tests/api/__init__.py @@ -0,0 +1,16 @@ +from unittest import mock + +from falcon import testing + + +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 = "test output" + self.addCleanup(self.patcher.stop) + + from snekbox.api import SnekAPI + self.app = SnekAPI() |