diff options
| author | 2019-09-14 22:11:22 +0200 | |
|---|---|---|
| committer | 2019-09-14 22:11:22 +0200 | |
| commit | 4d4691bc4feffb89470625e013a70d7d64f46a2f (patch) | |
| tree | 298a514d6ccce9af6ee3ca41bcf3f35794cfe503 /tests/api/__init__.py | |
| parent | Rename .github/FUNDING.yml to .github/.github/FUNDING.yml (diff) | |
| parent | Merge pull request #41 from python-discord/fix-flake8-docstrings (diff) | |
Merge pull request #22 from python-discord/revitalisation
Revitalisation
Diffstat (limited to 'tests/api/__init__.py')
| -rw-r--r-- | tests/api/__init__.py | 23 |
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() |