Skip to content

Commit

Permalink
fix: check that required fields are not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
regisb committed Nov 8, 2024
1 parent 3ed253f commit ff91218
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ def test_names_are_unique(self) -> None:
names.add(plugin["name"])

def test_all_plugins_have_all_fields(self) -> None:
required_fields = ["src", "url", "author", "maintainer", "description"]
for release in RELEASES:
for index in INDEXES:
for plugin in load_index(release, index):
self.assertIn("src", plugin)
self.assertIn("url", plugin)
self.assertIn("author", plugin)
self.assertIn("maintainer", plugin)
self.assertIn("description", plugin)
for field in required_fields:
self.assertIn(field, plugin)
self.assertTrue(
plugin[field] and plugin[field].strip(),
f"Field {field} cannot be empty",
)


def load_index(release: str, index: str) -> list[dict[str, str]]:
Expand Down

0 comments on commit ff91218

Please sign in to comment.