Skip to content

Add unit tests for _create() and _update() OData paths - #138

Closed
Saurabh Ravindra Badenkal (saurabhrb) with Copilot wants to merge 2 commits into
fix/preserve-odata-bind-casingfrom
copilot/sub-pr-137
Closed

Saurabh Ravindra Badenkal (saurabhrb) with Copilot wants to merge 2 commits into
fix/preserve-odata-bind-casingfrom
copilot/sub-pr-137

Conversation

Copilot AI commented Mar 12, 2026 •

Copy link
Copy Markdown
Contributor

Adds test coverage for the _create() and _update() internal methods of _ODataClient, which were missing from the @odata.bind case-preservation fix in #137.

New test classes

TestCreate (8 tests)

  • POST issued to correct entity set URL
  • GUID extracted from OData-EntityId, OData-EntityID (uppercase D), and Location headers
  • RuntimeError raised when no GUID present in any header
  • Field keys lowercased; @odata.bind nav property casing preserved
  • Warning emitted on lowercase @odata.bind key

TestUpdate (10 tests)

  • PATCH issued with If-Match: * header
  • URL constructed from _entity_set_from_schema_name + bare/parenthesised GUID
  • Field keys lowercased; @odata.bind nav property casing preserved
  • Warning emitted on lowercase @odata.bind key
  • Returns None; entity set delegated correctly

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…paths

Co-authored-by: saurabhrb <32964911+saurabhrb@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Add tests for _create() and _update() in OData handling Mar 12, 2026
@saurabhrb
Saurabh Ravindra Badenkal (saurabhrb) marked this pull request as ready for review March 12, 2026 19:09
Suyash Kshirsagar (suyask-msft) added a commit that referenced this pull request Mar 12, 2026
Add tests from Copilot PR #138 review that cover additional _create()
and _update() behavior beyond @odata.bind casing: GUID extraction from
OData-EntityID (uppercase D) and Location header fallback, RuntimeError
on missing GUID, If-Match: * header, bare GUID parenthesization, and
entity set resolution delegation. Excludes the warning tests from #138
since the warning was removed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants