fix: Resolve all test failures and improve error handling #25
Merged
wiresio merged 2 commits intoeclipse-thingweb:mainfrom Mar 19, 2026
Merged
fix: Resolve all test failures and improve error handling #25wiresio merged 2 commits intoeclipse-thingweb:mainfrom
wiresio merged 2 commits intoeclipse-thingweb:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to resolve current CI test failures and make error handling consistent with the app’s AppException JSON error responses (Fixes #24).
Changes:
- Made
pytest_httpxcallbacks reusable in SPARQL mock fixtures to avoid callback exhaustion across multiple requests. - Replaced
abort(404)with raisingIDNotFoundso Flask’sAppExceptionhandler returnsapplication/problem+json. - Updated the test TDD description fixture to include
response.contentTypefields and reformatted JSON.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tdd/tests/data/tdd-description.json | Reformats test fixture and adds missing response.contentType entries. |
| tdd/tests/conftest.py | Updates httpx_mock.add_callback usage to be reusable across requests. |
| tdd/lib/init.py | Adds package marker so tdd.lib works with importlib.resources. |
| tdd/errors.py | Expands IDNotFound to provide a clearer title and localized messages. |
| tdd/common.py | Switches 404 handling from abort() to raising IDNotFound. |
| .gitignore | Ignores local venv and generated JS artifacts under tdd/lib. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1 @@ | |||
| # JavaScript library module | |||
There was a problem hiding this comment.
This file is only used to make tdd.lib a Python package for importlib.resources; the current comment # JavaScript library module is potentially misleading given it’s a Python package. Consider replacing it with a short module docstring clarifying it exists to package/access built JS assets.
Suggested change
| # JavaScript library module | |
| """Package providing access to built JavaScript assets via importlib.resources.""" |
…reusable=True to HTTP mock callbacks (fixes 21 tests) - Fixed IDNotFound exception to use proper error handler instead of abort() Fixes eclipse-thingweb#24 Signed-off-by: jona42-ui <jonathanthembo123@gmail.com>
dbb062c to
8f6dc97
Compare
Member
|
Thanks @jona42-ui! |
This file contains hidden or 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
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.
Fixes #24