Skip to content

Commit

Permalink
Test doc added (#23)
Browse files Browse the repository at this point in the history
* test apidoc renamed

* tests doc added
  • Loading branch information
Purvanshsingh authored Jul 12, 2021
1 parent 684987a commit 5ddb24d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
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.

0 comments on commit 5ddb24d

Please sign in to comment.