note that this requires a change in swh-core's RPCClient (exposing self.check_status(), see D2266) that is not pushed yet, so CI will fail
Details
- Reviewers
seirl vlorentz - Group Reviewers
Reviewers - Commits
- rDGRPHb1c8234fad06: test_api_client: check HTTP status codes for bad requests
rDGRPHe2f31c2b3e8f: test_api_client.py: do not test /walk parameter validation
rDGRPH4fd7d3250395: client.py: renamse check_status -> raise_for_status
rDGRPH3d5083ee11f4: add tests for parameter validation
Diff Detail
- Repository
- rDGRPH Compressed graph representation
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Build has FAILED
Link to build: https://jenkins.softwareheritage.org/job/DGRPH/job/tox/95/
See console output for more information: https://jenkins.softwareheritage.org/job/DGRPH/job/tox/95/console
Could you make the tests check for the error message? (with raises(RemoteException, match='regexp'):)
I really think that's an antipattern. If anything, we should stop doing it elsewhere rather than adding it in more places.
If the type of error matters (which is arguably the case here), it should be captured by exception attributes other than a human readable message, e.g., exception type, exception properties, etc.
- client.py: renamse check_status -> raise_for_status
- test_api_client: check HTTP status codes for bad requests
Build has FAILED
Link to build: https://jenkins.softwareheritage.org/job/DGRPH/job/tox/100/
See console output for more information: https://jenkins.softwareheritage.org/job/DGRPH/job/tox/100/console
Now done. With the last changes in D2266 we can now check that the returned HTTP status codes here are correct.
- add tests for parameter validation
- client.py: renamse check_status -> raise_for_status
- test_api_client: check HTTP status codes for bad requests
Build has FAILED
Link to build: https://jenkins.softwareheritage.org/job/DGRPH/job/tox/106/
See console output for more information: https://jenkins.softwareheritage.org/job/DGRPH/job/tox/106/console
- add tests for parameter validation
- client.py: renamse check_status -> raise_for_status
- test_api_client: check HTTP status codes for bad requests
- test_api_client.py: do not test /walk parameter validation
Build is green
See https://jenkins.softwareheritage.org/job/DGRPH/job/tox/109/ for more details.