Skip to content

Conversation

@masachika-kamada
Copy link
Contributor

Description

This PR adds unit tests for the DataverseClient class in tests/unit/test_client.py.

Motivation

Currently, DataverseClient lacks direct unit tests. These tests ensure that the public API methods (create, get, update, delete) correctly delegate operations to the underlying _ODataClient.

Changes

  • Created tests/unit/test_client.py
  • Added tests for single and multiple record operations for Create, Update, Delete, and Get.
  • Used unittest.mock to isolate DataverseClient logic from network calls.

Verification

  • Ran pytest tests/unit/test_client.py and confirmed all 8 tests passed.
  • Ran ruff and black to ensure code style compliance.

Added comprehensive unit tests for the DataverseClient class in tests/unit/test_client.py. These tests mock the internal _ODataClient to verify that the public API methods (create, get, update, delete) correctly delegate to the underlying OData implementation.
Copilot AI review requested due to automatic review settings November 22, 2025 13:40
@masachika-kamada masachika-kamada requested a review from a team as a code owner November 22, 2025 13:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive unit tests for the DataverseClient class, which previously lacked direct test coverage. The tests use mocking to isolate the client logic from network calls and verify that public API methods correctly delegate to the underlying _ODataClient.

  • Added 8 unit tests covering Create, Read, Update, and Delete operations for both single and multiple records
  • Used unittest.mock to mock the internal _ODataClient for isolated testing
  • Verified proper delegation of method calls with correct parameters

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zhaodongwang-msft
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@zhaodongwang-msft zhaodongwang-msft merged commit 77eb320 into microsoft:main Dec 17, 2025
2 checks passed
@zhaodongwang-msft
Copy link
Collaborator

merged it. @masachika-kamada thanks for the contribution!

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