Repository navigation
Raise Client.py unit coverage to 95% and fix pull/DatabaseError bugs - #484
Merged
Merged
Conversation
Adds 46 tests to test_Client.py driving the real connect() flow under mocked session responses: module classes (WoqlResult iteration and error paths, JWTAuth/APITokenAuth headers, Patch update/before transforms and property guards), all _auth() variants including jwt/api/env-token and the disconnected RuntimeError, streaming query via WoqlResult, connect/close lifecycle, delete_database/create_branch/delete_branch/patch_resource, prefix CRUD, document read/write with data versions and iterable inputs, VCS operations, diff variants, organization/database listing, URL builders across _system/_meta/_commits/ref branches, and connection guards. Fixes two real bugs surfaced by the tests: pull() referenced self.author which does not exist and now uses self._author, and DatabaseError raised AttributeError when WoqlResult passed a parsed dict, so it now accepts dict payloads and extracts api:message/vio:message details. Client.py coverage: 53% to 95%, 1405 tests passing.
Cherry-picked from triple-relation (ccc825f). Engine commit f87a3b57 changed sys:JSONDocument reads to omit @id by default (raw_id=false) so @-prefixed raw JSON keys survive intact. The test inserted a doc without @id and read it back expecting @id in the payload, which now KeyErrors on the dev image and fails every matrix run. Insert with an explicit @id and assert has_doc against it directly - same False-then-True contract, no dependence on read shape.
The main merge placed the appended coverage tests flush against the incoming test_diff_version; flake8 requires two blank lines between top-level definitions.
hoijnet
approved these changes
Nov 11, 2026
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.
Adds 46 tests to test_Client.py driving the real connect() flow under mocked session responses: module classes (WoqlResult iteration and error paths, JWTAuth/APITokenAuth headers, Patch update/before transforms and property guards), all _auth() variants including jwt/api/env-token and the disconnected RuntimeError, streaming query via WoqlResult, connect/close lifecycle, delete_database/create_branch/delete_branch/patch_resource, prefix CRUD, document read/write with data versions and iterable inputs, VCS operations, diff variants, organization/database listing, URL builders across _system/_meta/_commits/ref branches, and connection guards. Fixes two real bugs surfaced by the tests: pull() referenced self.author which does not exist and now uses self._author, and DatabaseError raised AttributeError when WoqlResult passed a parsed dict, so it now accepts dict payloads and extracts api:message/vio:message details. Client.py coverage: 53% to 95%, 1405 tests passing.
AI Assisted