Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

schemaview.py: add tests for get_identifier_slot and get_key_slot - #464

Merged
ialarmedalien merged 1 commit into
mainfrom
schemaview_identifier_key_tests
Oct 3, 2025
Merged

ialarmedalien merged 1 commit into
mainfrom
schemaview_identifier_key_tests

Conversation

@ialarmedalien

Copy link
Copy Markdown
Collaborator

Add tests for get_identifier_slot and get_key_slot.

The method of generating the tests may look suspiciously familiar...

Ideally when linkml and linkml-runtime are merged into a single happy family, some of these repeated fixtures can be eliminated.

@ialarmedalien
ialarmedalien requested a review from dalito October 2, 2025 21:36
@ialarmedalien ialarmedalien self-assigned this Oct 2, 2025
@ialarmedalien ialarmedalien added enhancement New feature or request testing labels Oct 2, 2025
@codecov

codecov Bot commented Oct 2, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.40%. Comparing base (9be4b3e) to head (83e34c9).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #464      +/-   ##
==========================================
+ Coverage   77.37%   77.40%   +0.02%     
==========================================
  Files          52       52              
  Lines        4478     4478              
  Branches      979      979              
==========================================
+ Hits         3465     3466       +1     
  Misses        785      785              
+ Partials      228      227       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

:return: slot that acts as identifier, if present
"""
for sn in self.class_slots(cn, imports=imports):
for sn in sorted(self.class_slots(cn, imports=imports)):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Allows the identifier (or key) slot to be predicted in cases where there are several slots marked as ID/key. Of course, the user will already have run the linter to eliminate the possibility of there being several ID/key slots...

@dalito dalito left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This was easy to review 😄

@ialarmedalien
ialarmedalien merged commit 9d191ad into main Oct 3, 2025
17 checks passed
@ialarmedalien
ialarmedalien deleted the schemaview_identifier_key_tests branch October 3, 2025 13:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants