Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test doc added #23

Merged
merged 2 commits into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# tests for creditrisk-poc

tests for creditrisk-poc are written with [pytest](https://docs.pytest.org/en/6.2.x/) testing framework.

## tests directory contains folloing files :
```
tests
|
|__ conftest.py
|__ mock_portfolio_generator.py
|__ test_01_ApiDoc.jsonld
|__ test_functional.py
```

`test_functional.py` contains all the functional tests for creditrisk-poc.

`mock_portfolio_generator.py` is a mock client which can populate the database with realistic portfolio data.

`test_01_ApiDoc.jsonld` is the ApiDoc used for testing & data generation.

## To run tests enter the following command in the terminal :
```python
pytest tests/
```
## Current status:
All tests are passing successfully with the latest changes.

![Screenshot from 2021-07-12 16-43-15](https://user-images.githubusercontent.com/49719371/125278454-648f9980-e330-11eb-911f-26a3d744e830.png)
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_doc(constants):
HYDRUS_SERVER_URL = constants['HYDRUS_SERVER_URL']
API_NAME = constants['API_NAME']
cwd_path = Path(dirname(dirname(abspath(__file__))))
API_DOC_PATH = cwd_path / "tests" / "ApiDoc.jsonld"
API_DOC_PATH = cwd_path / "tests" / "test_01_ApiDoc.jsonld"
doc_file = open(API_DOC_PATH, "r")
doc = json.load(doc_file)

Expand Down
2 changes: 1 addition & 1 deletion tests/mock_portfolio_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import ast


def get_api_doc(apidoc_file_path: str = "ApiDoc.jsonld") -> HydraDoc:
def get_api_doc(apidoc_file_path: str = "test_01_ApiDoc.jsonld") -> HydraDoc:
"""
Returns HydraDoc object from API Documentation
"""
Expand Down
File renamed without changes.