88)
99from exasol .toolbox .util .version import Version
1010
11- CHANGES_CONTENTS = cleandoc (
12- """
13- # Changelog
14-
15- * [unreleased](unreleased.md)
16- * [0.1.0](changes_0.1.0.md)
17-
18- ```{toctree}
19- ---
20- hidden:
21- ---
22- unreleased
23- changes_0.1.0
24- ```
25- """
26- )
27-
28- ALTERED_CHANGES_CONTENTS = cleandoc (
29- """
30- # Changelog
31-
32- * [unreleased](unreleased.md)
33- * [1.0.0](changes_1.0.0.md)
34- * [0.1.0](changes_0.1.0.md)
35-
36- ```{toctree}
37- ---
38- hidden:
39- ---
40- unreleased
41- changes_1.0.0
42- changes_0.1.0
43- ```
44- """
45- )
46-
47- SHARED_TEXT = cleandoc (
48- """
49- ## Added
50- * Added Awesome feature
5111
52- ## Changed
53- * Some behaviour
54-
55- ## Fixed
56- * Fixed nasty bug
57- """
58- )
12+ class SampleContent :
13+ changelog = cleandoc (
14+ """
15+ ## Added
16+ * Added Awesome feature
17+
18+ ## Changed
19+ * Some behaviour
20+
21+ ## Fixed
22+ * Fixed nasty bug
23+ """
24+ )
25+ changes = cleandoc (
26+ """
27+ # Changelog
28+
29+ * [unreleased](unreleased.md)
30+ * [0.1.0](changes_0.1.0.md)
31+
32+ ```{toctree}
33+ ---
34+ hidden:
35+ ---
36+ unreleased
37+ changes_0.1.0
38+ ```
39+ """
40+ )
41+ altered_changes = cleandoc (
42+ """
43+ # Changelog
44+
45+ * [unreleased](unreleased.md)
46+ * [1.0.0](changes_1.0.0.md)
47+ * [0.1.0](changes_0.1.0.md)
48+
49+ ```{toctree}
50+ ---
51+ hidden:
52+ ---
53+ unreleased
54+ changes_1.0.0
55+ changes_0.1.0
56+ ```
57+ """
58+ )
5959
6060
6161@pytest .fixture (scope = "function" )
6262def changes_md (changelogs ):
63- changelogs .changelog_md .write_text (CHANGES_CONTENTS )
63+ changelogs .changelog_md .write_text (SampleContent . changes )
6464
6565
6666@pytest .fixture (scope = "function" )
6767def unreleased_md (changelogs ):
68- changelogs .unreleased_md .write_text (UNRELEASED_INITIAL_CONTENT + SHARED_TEXT )
68+ changelogs .unreleased_md .write_text (
69+ UNRELEASED_INITIAL_CONTENT + SampleContent .changelog
70+ )
6971
7072
7173@pytest .fixture (scope = "function" )
@@ -87,33 +89,33 @@ def test_create_new_unreleased(changelogs):
8789
8890 @staticmethod
8991 def test_create_versioned_changelog (changelogs ):
90- changelogs ._create_versioned_changelog (SHARED_TEXT )
92+ changelogs ._create_versioned_changelog (SampleContent . changelog )
9193 saved_text = changelogs .versioned_changelog_md .read_text ()
9294
9395 assert "1.0.0" in saved_text
94- assert SHARED_TEXT in saved_text
96+ assert SampleContent . changelog in saved_text
9597
9698 @staticmethod
9799 def test_extract_unreleased_notes (changelogs , unreleased_md ):
98100 result = changelogs ._extract_unreleased_notes ()
99101
100- assert result == SHARED_TEXT + "\n "
102+ assert result == SampleContent . changelog + "\n "
101103
102104 @staticmethod
103105 def test_update_changelog_table_of_contents (changelogs , changes_md ):
104106 changelogs ._update_changelog_table_of_contents ()
105107
106- assert changelogs .changelog_md .read_text () == ALTERED_CHANGES_CONTENTS
108+ assert changelogs .changelog_md .read_text () == SampleContent . altered_changes
107109
108110 @staticmethod
109111 def test_update_changelogs_for_release (changelogs , unreleased_md , changes_md ):
110112 changelogs .update_changelogs_for_release ()
111113
112114 # changes.md
113- assert changelogs .changelog_md .read_text () == ALTERED_CHANGES_CONTENTS
115+ assert changelogs .changelog_md .read_text () == SampleContent . altered_changes
114116 # unreleased.md
115117 assert changelogs .unreleased_md .read_text () == UNRELEASED_INITIAL_CONTENT
116118 # versioned.md
117119 saved_text = changelogs .versioned_changelog_md .read_text ()
118120 assert "1.0.0" in saved_text
119- assert SHARED_TEXT in saved_text
121+ assert SampleContent . changelog in saved_text
0 commit comments