-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: create file for backend and info view integration tests
- Loading branch information
Showing
12 changed files
with
64 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
""" | ||
Integration test for EOX Info view. | ||
""" | ||
import requests | ||
from django.conf import settings as ds | ||
from django.test import TestCase | ||
from django.urls import reverse | ||
from rest_framework import status | ||
|
||
settings = ds.INTEGRATION_TEST_SETTINGS | ||
|
||
|
||
class TestInfoView(TestCase): | ||
""" | ||
Integration test suite for the info view. | ||
""" | ||
|
||
def setUp(self) -> None: | ||
""" | ||
Set up the test suite. | ||
""" | ||
self.url = f"{settings['EOX_TAGGING_BASE_URL']}{reverse('eox-info')}" | ||
super().setUp() | ||
|
||
def test_info_view_success(self) -> None: | ||
"""Test the info view. | ||
Expected result: | ||
- The status code is 200. | ||
- The response contains the version, name and git commit hash. | ||
""" | ||
response = requests.get(self.url, timeout=settings["API_TIMEOUT"]) | ||
|
||
response_data = response.json() | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
self.assertIn("version", response_data) | ||
self.assertIn("name", response_data) | ||
self.assertIn("git", response_data) | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
echo "Install test-requirements" | ||
make install-dev-dependencies | ||
|
||
echo "Run tests" | ||
pytest -rPf ./eox_tagging/test/integration --ignore=test_api_integration.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters