-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add more tests (based on optimade-python-tools) #74
Merged
Conversation
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
Codecov Report
@@ Coverage Diff @@
## develop #74 +/- ##
===========================================
+ Coverage 69.75% 72.89% +3.13%
===========================================
Files 16 16
Lines 830 819 -11
===========================================
+ Hits 579 597 +18
+ Misses 251 222 -29
Continue to review full report at Codecov.
|
These are all based on the tests in optimade-python-tools. Removed several test files that are not relevant for aiida-optimade. Updated transformer tests to be applicable with AiidaTransformer. Added an update of package version to invoke task for /tests/test_config.json.
Rename test classes to be discoverable Fix some structures tests.
Further modularize test code
Subclass FastAPI/Starlette's `TestClient` in order to prepend path requests with the version path. This is done, since the `TestClient` otherwise uses `urllib.parse.urljoin` to combine the custom `base_url` attribute with the requested path URI. In doing this, any paths included in the `base_url` will be removed and only the requested path URI will remaing, using the scheme and netloc of `base_url`. So this is a way of injecting the OPTIMADE versioned base URL into the requests. A precaution is taken to not override requested complete URLs by checking for a scheme after using `urllib.parse.urlparse` on the requested URL. Furthermore, the client is wrapped in a factory function in order to create a client with a specific versioned base URL. If no version is passed to the factory function, the current OPTIMADE API version's major part it used (the mandatory versioned base URL).
Run through the differently versioned base URL servers and make sure all Open API endpoints are redirected to the major versioned base URL.
CasperWA
changed the title
[WIP] Add more tests (based on optimade-python-tools)
Add more tests (based on optimade-python-tools)
Jun 2, 2020
This was referenced Jun 2, 2020
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement more tests, based on the tests in
optimade-python-tools
.Convert from
unittest
to usingpytest
instead.There are still some optimizations that can be done in this new code:
Update middleware tests when Redirect special OpenAPI endpoints for custom base URLs #72 has been merged.Done.