Repository navigation
Conversation
core.entities.plugin_credential_type.PluginCredentialType is an enum whose numeric values are an API contract (MODEL must be 0, TOOL must be 1). Add 16 regression cases covering the wire values, to_number(), construction from values, member set, name/value lookup, invalid input rejection, hashing and repr/str. Purely additive: one new test file, 0 deletions.
Contributor
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #46026 +/- ##
=======================================
Coverage 90.13% 90.13%
=======================================
Files 6302 6302
Lines 394481 394481
Branches 79133 79133
=======================================
+ Hits 355560 355562 +2
+ Misses 32813 32808 -5
- Partials 6108 6111 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
wylswz
approved these changes
Nov 12, 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.
Summary
Adds unit tests for the previously uncovered
core.entities.plugin_credential_type.PluginCredentialType.This is not just coverage padding: the source explicitly documents that
MODEL = 0andTOOL = 1are required for API contract compatibility. Reordering members or switching toauto()would silently break plugin clients, so the 16 cases pin the wire values,to_number(), value/name lookup, invalid-input rejection, member set, hashing andrepr/str.Purely additive: one new test file, 0 deletions, no production code touched.
Verification
Local, Python 3.13, using this repo's
[tool.pyrefly]andapi/.ruff.toml:pyrefly 1.5.0-dev.1 check(the version proposed in ci: bump tyck to check new err #45614): 0 diagnosticspytest: 16 passedruff check+ruff format --check: cleancore.entities..., noapi.prefix)main, LF line endingsAI-assisted test generation; assertions reflect the documented behaviour of the target enum.