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

Use mocking for TestModeOfTransportDistributionManager, separate testing of validator #41

Open
1kastner opened this issue Jan 11, 2022 · 0 comments
Labels
good first issue Good for newcomers technical-debt This increases the code quality without changing the functionality

Comments

@1kastner
Copy link
Owner

The DatabaseChooser at https://github.com/1kastner/conflowgen/blob/main/conflowgen/tests/api/test_database_chooser.py is a good example of how to do mocking correct. In the API package, we only want to check whether the API class does its work. The used class instances etc. should not really be invoked. For those, we have other unit tests.

The test https://github.com/1kastner/conflowgen/blob/main/conflowgen/tests/api/test_mode_of_transport_distribution_manager.py is a bad example because the unit test does not isolate the ModeOfTransportDistributionManager. The validator which is currently tested here and which resides in https://github.com/1kastner/conflowgen/tree/main/conflowgen/domain_models/distribution_validators should get its own test at https://github.com/1kastner/conflowgen/tree/main/conflowgen/tests/domain_models.

@1kastner 1kastner added good first issue Good for newcomers technical-debt This increases the code quality without changing the functionality labels Jan 11, 2022
1kastner added a commit that referenced this issue Jan 11, 2022
Only #41 is a separat issue. Small dependencies from database models which are needed in the init method are acceptable though.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers technical-debt This increases the code quality without changing the functionality
Projects
None yet
Development

No branches or pull requests

1 participant