fix sample

This commit is contained in:
cclecle
2023-03-25 14:54:07 +00:00
parent de26b3ffb8
commit 8acb97b7d6
2 changed files with 19 additions and 18 deletions

View File

@@ -56,12 +56,16 @@ print(changelog)
### Output(Raw)
#### Features :sparkles::
> feat: add a nice feature to the project
> add a nice feature to the project
#### Security :shield::
> security: fix a security leak on the Foo2 component
> fix a security leak on the Foo2 component
#### Style :art::
> reindent the full Foo class
### Output (rendered)
#### Features :sparkles::
> feat: add a nice feature to the project
> add a nice feature to the project
#### Security :shield::
> security: fix a security leak on the Foo2 component
> fix a security leak on the Foo2 component
#### Style :art::
> reindent the full Foo class

View File

@@ -43,7 +43,6 @@ class Testtest_module(unittest.TestCase):
raw = "break: testbreak" + "\n" + "docs: testdoc" + "\n" + "style: teststyle" + "\n" + "test: testtest"
pychangelogfactory.ChangeLogFormater.FactoryProcessFullChangelog(raw)
changelog = pychangelogfactory.ChangeLogFormater.RenderFullChangelog().splitlines()
print(changelog)
self.assertIn("testbreak", changelog[1])
self.assertIn("teststyle", changelog[3])
self.assertIn("testdoc", changelog[5])
@@ -120,23 +119,21 @@ class Testtest_module(unittest.TestCase):
self.simplegeneration("revert: teststring", ["~~teststring~~"])
def test_sample(self):
raw_changelog = """
feat: add a nice feature to the project
style: reindent the full Foo class
security: fix a security leak on the Foo2 component
"""
raw_changelog = (
"feat: add a nice feature to the project\n"
"style: reindent the full Foo class\n"
"security: fix a security leak on the Foo2 component"
)
pychangelogfactory.ChangeLogFormater.FactoryProcessFullChangelog(raw_changelog)
changelog = pychangelogfactory.ChangeLogFormater.RenderFullChangelog()
expected_formated = (
"#### Features :sparkles::"
+ "\n"
+ "> feat: add a nice feature to the project"
+ "\n"
+ "#### Security :shield::"
+ "\n"
+ "> security: fix a security leak on the Foo2 component"
+ "\n"
"#### Features :sparkles::\n"
"> add a nice feature to the project\n"
"#### Security :shield::\n"
"> fix a security leak on the Foo2 component\n"
"#### Style :art::\n"
"> reindent the full Foo class\n"
)
self.assertEqual(changelog, expected_formated)