aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_api.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py25
1 files changed, 0 insertions, 25 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
deleted file mode 100644
index b20dc0c5..00000000
--- a/tests/test_api.py
+++ /dev/null
@@ -1,25 +0,0 @@
-from tests import SiteTest, app
-
-class ApiEndpoints(SiteTest):
- """ Test cases for the api subdomain """
- def test_api_unknown_route(self):
- """ Check api unknown route """
- response = self.client.get('/', app.config['API_SUBDOMAIN'])
- self.assertEqual(response.json, {'error_code': 0, 'error_message': 'Unknown API route'})
- self.assertEqual(response.status_code, 404)
-
- def test_api_healthcheck(self):
- """ Check healthcheck url responds """
- response = self.client.get('/healthcheck', app.config['API_SUBDOMAIN'])
- self.assertEqual(response.json, {'status': 'ok'})
- self.assertEqual(response.status_code, 200)
-
- def test_api_route_errors(self):
- """ Check api route errors """
- from pysite.base_route import APIView
- from pysite.constants import ErrorCodes
-
- av = APIView()
- av.error(ErrorCodes.unauthorized)
- av.error(ErrorCodes.bad_data_format)
-