Merge pull request #194 from bombsquad-community/add-test-for-changelog-entries

Add a test for plugin manager changelog entries
This commit is contained in:
rikkolovescats 2023-10-06 19:05:37 +05:30 committed by GitHub
commit 187f6f6676
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 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,15 @@ 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):