Skip to content

Raise Client.py unit coverage to 95% and fix pull/DatabaseError bugs - #484

Merged
hoijnet merged 4 commits into
mainfrom
chore/client-test-coverage
Nov 11, 2026
Merged

hoijnet merged 4 commits into
mainfrom
chore/client-test-coverage

Conversation

@dfrnt-hoijnet

Copy link
Copy Markdown
Contributor

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

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
hoijnet merged commit 34d1bbf into main Nov 11, 2026
10 checks passed
@hoijnet
hoijnet deleted the chore/client-test-coverage branch November 11, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants