Add a test for plugin manager changelog entries

This commit is contained in:
Rikko 2023-10-06 19:04:16 +05:30
parent dcf4545171
commit ce526371cb
No known key found for this signature in database
2 changed files with 13 additions and 0 deletions

View file

@ -78,3 +78,7 @@
### 0.1.5 (08-09-2022)
- Plugin files that export classes besides plugin or game, now work.
### 0.1.4 (05-09-2022)
- First public release of plugin manager. 🎉

View file

@ -21,6 +21,7 @@ class TestPluginManagerMetadata(unittest.TestCase):
self.plugin_manager_version_regexp = re.compile(b"(?<=PLUGIN_MANAGER_VERSION = )(.*)")
self.current_path = pathlib.Path()
self.changelog = self.current_path / "CHANGELOG.md"
self.repository = git.Repo()
def test_keys(self):
@ -68,6 +69,14 @@ class TestPluginManagerMetadata(unittest.TestCase):
self.assertEqual(int(api_version.decode("utf-8")), latest_version_metadata["api_version"])
self.assertEqual(plugin_manager_version.decode("utf-8"), f'"{latest_version_name}"')
def test_changelog_entries(self):
versions = tuple(self.content["versions"].keys())
with open(self.changelog, "r") as fin:
changelog = fin.read()
for version in versions:
changelog_version_header = f"## {version}"
if changelog_version_header not in changelog:
self.fail(f"Changelog entry for plugin manager {version} is missing.")
class TestPluginMetadata(unittest.TestCase):
def setUp(self):