-
Notifications
You must be signed in to change notification settings - Fork 0
Promote Develop to Main #914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b1fec3e
Declare the Repository Description in registry/repos.json (#639) (#913)
ptr727 f17351c
Guard load_repo_tools Against an Empty install.linux Set (#916) (#917)
ptr727 abfeb98
Fix Review Findings From the Develop-to-Main Promotion PR (#915)
ptr727 6b4929d
Delegate configure.sh's Description Check to Python Too (#918)
ptr727 f726c7a
Reject a Case-Only Registry Name Mismatch Too (#919)
ptr727 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| #!/usr/bin/env python3 | ||
| """Exercise resolve_description()'s registry-shape and fail-loud guards directly.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import sys | ||
| import unittest | ||
| from pathlib import Path | ||
|
|
||
| sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "spec")) | ||
| import resolve_description | ||
|
|
||
|
|
||
| class ResolveDescriptionCase(unittest.TestCase): | ||
| """repo-config/configure.sh's declared-description resolution (spec/resolve_description.py).""" | ||
|
|
||
| def test_a_repo_with_no_declared_description_resolves_to_none(self) -> None: | ||
| registry = {"repos": [{"name": "Fixture"}]} | ||
| self.assertIsNone(resolve_description.resolve_description(registry, "Fixture")) | ||
|
|
||
| def test_a_repo_absent_from_the_registry_resolves_to_none(self) -> None: | ||
| registry = {"repos": [{"name": "Other"}]} | ||
| self.assertIsNone(resolve_description.resolve_description(registry, "Fixture")) | ||
|
|
||
| def test_a_valid_declared_description_is_returned(self) -> None: | ||
| registry = {"repos": [{"name": "Fixture", "description": "A short tagline."}]} | ||
| self.assertEqual( | ||
| resolve_description.resolve_description(registry, "Fixture"), "A short tagline." | ||
| ) | ||
|
|
||
| def test_a_duplicate_name_raises_rather_than_picking_one(self) -> None: | ||
| registry = { | ||
| "repos": [ | ||
| {"name": "Fixture", "description": "First."}, | ||
| {"name": "Fixture", "description": "Second."}, | ||
| ] | ||
| } | ||
| with self.assertRaises(resolve_description.ResolveError): | ||
| resolve_description.resolve_description(registry, "Fixture") | ||
|
|
||
| def test_an_invalid_declared_description_raises(self) -> None: | ||
| registry = {"repos": [{"name": "Fixture", "description": None}]} | ||
| with self.assertRaises(resolve_description.ResolveError): | ||
| resolve_description.resolve_description(registry, "Fixture") | ||
|
|
||
| def test_a_registry_with_no_repos_array_raises_rather_than_reading_as_no_match(self) -> None: | ||
| with self.assertRaises(resolve_description.ResolveError): | ||
| resolve_description.resolve_description({}, "Fixture") | ||
|
|
||
| def test_a_repos_value_that_is_not_a_list_raises(self) -> None: | ||
| with self.assertRaises(resolve_description.ResolveError): | ||
| resolve_description.resolve_description({"repos": "not-a-list"}, "Fixture") | ||
|
|
||
| def test_a_padded_name_that_would_otherwise_match_raises_rather_than_reading_as_absent( | ||
| self, | ||
| ) -> None: | ||
| registry = {"repos": [{"name": " Fixture ", "description": "A short tagline."}]} | ||
| with self.assertRaises(resolve_description.ResolveError): | ||
| resolve_description.resolve_description(registry, "Fixture") | ||
|
|
||
| def test_a_case_only_name_mismatch_raises_rather_than_reading_as_absent(self) -> None: | ||
| registry = {"repos": [{"name": "fixture", "description": "A short tagline."}]} | ||
| with self.assertRaises(resolve_description.ResolveError): | ||
| resolve_description.resolve_description(registry, "Fixture") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.