aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_api.py
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-08-07 15:09:08 +0100
committerGravatar Gareth Coles <[email protected]>2018-08-07 15:09:16 +0100
commitaf54db6c136138c66cf5ca72419989525a0baa5c (patch)
tree8519aeab8d45277c51797c7dc23aacf3b56ed1bb /tests/test_api.py
parentA wizard is never late, nor is he early. (diff)
Initial project layout for django
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)
-