Skip to content

chore(tests): added test for numpy version #178

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

Merged
merged 1 commit into from
Sep 25, 2024
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ After cloning the repository, use the `poetry` python package manager to install
- Create a `.env` file in the `frontend` directory of the project by copying the `.env.example` file and updating the values as needed. For development, the `DJANGO_DEBUG` variable should be set to `True`.
- To run the django server locally, install docker and docker-compose. Run `docker compose -f ./frontend/docker-compose.dev.yml up --build` to start the development server. The app will be available at `http://localhost:8003`. Note: the non-dev version of the app is served via nginx at `http://localhost:{WEB_PORT}`.

## Running tests locally

To run Django tests, it is easiest to build the Docker container and attach to the running shell. The command `python manage.py test` executes the tests in Django.

##### Contributing Authors

NHC (Tyler De Jong, Tobias Müller), ENV X
9 changes: 8 additions & 1 deletion frontend/rctool/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import datetime as dt
from io import StringIO
import json

from itertools import chain
import numpy as np

# Tests data import and export from sample_data.csv
class BaseTestCase(TestCase):
Expand Down Expand Up @@ -196,3 +197,9 @@ def test_export_rc_data_form(self):
# check if the output is a pdf:
assert response_output.status_code == 200
assert response_output["Content-Type"] == "application/pdf"

def test_numpy_version(self):
# numpy version has to be 1 to avoid formatting problems with float numbers output by numpy. Would take a lot of refactoring otherwise...
np_version = np.__version__.split(".")[0]
print(f"numpy version: {np_version}")
assert np_version == "1"
Loading