Skip to content

Commit 0b547ba

Browse files
committed
test: move changelog sample into updater fixtures
1 parent 66a7c00 commit 0b547ba

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

projects/policyengine-api-simulation/fixtures/test_country_package_update_scripts.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@
1515

1616
SCRIPT = SCRIPTS_DIR / "update-country-package.sh"
1717
CHANGELOG_SCRIPT = SCRIPTS_DIR / "check-country-package-updates.py"
18+
SAMPLE_CHANGELOG = """
19+
# Changelog
20+
21+
## 1.2.2
22+
### Added
23+
- New variable
24+
25+
### Fixed
26+
- Important bug fix
27+
28+
## [1.2.1]
29+
### Changed
30+
- Existing calculation changed
31+
32+
## 1.2.0
33+
### Added
34+
- Old change
35+
"""
1836

1937

2038
@pytest.fixture

projects/policyengine-api-simulation/tests/test_country_package_update_scripts.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import pytest
1010

1111
from fixtures.test_country_package_update_scripts import (
12+
SAMPLE_CHANGELOG,
1213
SCRIPT,
1314
install_fake_gh,
1415
install_fake_git,
@@ -178,26 +179,7 @@ def test_update_country_package_updates_files_and_opens_pr(
178179
def test_parse_changelog_collects_versioned_category_items(
179180
changelog_module: ModuleType,
180181
) -> None:
181-
text = """
182-
# Changelog
183-
184-
## 1.2.2
185-
### Added
186-
- New variable
187-
188-
### Fixed
189-
- Important bug fix
190-
191-
## [1.2.1]
192-
### Changed
193-
- Existing calculation changed
194-
195-
## 1.2.0
196-
### Added
197-
- Old change
198-
"""
199-
200-
parsed = changelog_module.parse_changelog(text)
182+
parsed = changelog_module.parse_changelog(SAMPLE_CHANGELOG)
201183
changes = changelog_module.get_changes_between(parsed, "1.2.0", "1.2.2")
202184
formatted = changelog_module.format_changes(changes)
203185

0 commit comments

Comments
 (0)