aboutsummaryrefslogtreecommitdiffstats
path: root/tests/api/__init__.py
blob: 745519d6b4b4c905c95b8265b38c53539f9afeef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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()