Skip to content

Commit 204e16c

Browse files
committed
Add tests
1 parent 6ccbf0d commit 204e16c

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/docker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ jobs:
4343
pip install -r requirements-dev.txt
4444
4545
- name: Run tests
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4648
run: pytest
4749

4850
- name: Bump commit version

tests/test_converter.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ def test_format_pre_input(empty_repo, empty_release, case_name):
105105
assert parse_mode == FORMATTING_PARAMS["pre"]["mode"]
106106
assert message == dst_content
107107

108+
@pytest.mark.parametrize("case_name", get_test_cases())
109+
def test_format_html_input(empty_repo, empty_release, case_name):
110+
release_note_format = FORMATTING_PARAMS["html"]["format"]
111+
112+
orig_path = os.path.join(DATA_DIR, f"{case_name}.orig")
113+
dst_path = os.path.join(DATA_DIR, f"{case_name}.html")
114+
with open(orig_path, 'r', encoding='utf-8', newline="") as f:
115+
orig_content = f.read()
116+
with open(dst_path, 'r', encoding='utf-8', newline="") as f:
117+
dst_content = f.read()
118+
119+
empty_release.body = orig_content
120+
121+
message, parse_mode, entities = format_release_message(release_note_format, empty_repo, empty_release)
122+
123+
assert parse_mode in (FORMATTING_PARAMS["html"]["mode"], FORMATTING_PARAMS["markdown"]["mode"])
124+
assert message == dst_content
125+
108126
@pytest.mark.parametrize("case_name", get_test_cases())
109127
def test_format_markdown_input(empty_repo, empty_release, case_name):
110128
release_note_format = FORMATTING_PARAMS["markdown"]["format"]

0 commit comments

Comments
 (0)