aboutsummaryrefslogtreecommitdiffstats
path: root/tests/api
diff options
context:
space:
mode:
authorGravatar Mark <[email protected]>2022-06-04 12:49:47 -0700
committerGravatar GitHub <[email protected]>2022-06-04 12:49:47 -0700
commit2759fd453f5977f027a10cc672fed630ecc7de6c (patch)
treeecaa6114606415e3b95ba707661d70a1cb87fd90 /tests/api
parentMerge pull request #143 from python-discord/feat/tests/wsgi-app-from-cfg (diff)
parentCI: use GH's Ubuntu 22.04 runner instead of the self-hosted one (diff)
Merge #144 - add black and isort
Diffstat (limited to 'tests/api')
-rw-r--r--tests/api/__init__.py5
-rw-r--r--tests/api/test_eval.py10
2 files changed, 5 insertions, 10 deletions
diff --git a/tests/api/__init__.py b/tests/api/__init__.py
index a900316..3f7d250 100644
--- a/tests/api/__init__.py
+++ b/tests/api/__init__.py
@@ -14,10 +14,7 @@ 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 = CompletedProcess(
- args=[],
- returncode=0,
- stdout="output",
- stderr="error"
+ args=[], returncode=0, stdout="output", stderr="error"
)
self.addCleanup(self.patcher.stop)
diff --git a/tests/api/test_eval.py b/tests/api/test_eval.py
index 24e673a..976970e 100644
--- a/tests/api/test_eval.py
+++ b/tests/api/test_eval.py
@@ -20,15 +20,13 @@ class TestEvalResource(SnekAPITestCase):
expected = {
"title": "Request data failed validation",
- "description": "'input' is a required property"
+ "description": "'input' is a required property",
}
self.assertEqual(expected, result.json)
def test_post_invalid_data_400(self):
- bodies = (
- {"input": 400}, {"input": "", "args": [400]}
- )
+ bodies = ({"input": 400}, {"input": "", "args": [400]})
for body in bodies:
with self.subTest():
@@ -38,7 +36,7 @@ class TestEvalResource(SnekAPITestCase):
expected = {
"title": "Request data failed validation",
- "description": "400 is not of type 'string'"
+ "description": "400 is not of type 'string'",
}
self.assertEqual(expected, result.json)
@@ -52,7 +50,7 @@ class TestEvalResource(SnekAPITestCase):
expected = {
"title": "415 Unsupported Media Type",
- "description": "application/xml is an unsupported media type."
+ "description": "application/xml is an unsupported media type.",
}
self.assertEqual(expected, result.json)