fix sample
This commit is contained in:
@@ -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
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user