From d35b7fee83e89def77863ee5dff26dd527ba59ee Mon Sep 17 00:00:00 2001 From: drewcassidy Date: Sun, 9 May 2021 19:39:48 -0700 Subject: [PATCH] Fixed broken header in new changelogs --- CHANGELOG.md | 7 +++++++ tests/test_cli.py | 6 ++++++ yaclog/changelog.py | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a97829f..b8e25e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file +## 1.0.1 - 2021-05-10 + +### Fixed + +- Fixed broken header in new changelogs + + ## 1.0.0 - 2021-05-07 ### Changed diff --git a/tests/test_cli.py b/tests/test_cli.py index 6a36e54..fbb4425 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -28,6 +28,12 @@ class TestCreation(unittest.TestCase): self.assertTrue(os.path.exists(os.path.abspath(location)), 'yaclog init did not create a file') self.assertIn(location, result.output, "yaclog init did not echo the file's correct location") + with open(location, 'r') as fp: + self.assertEqual('# Changelog\n', fp.readline()) + self.assertEqual('\n', fp.readline()) + self.assertEqual('All notable changes to this project will be documented in this file', + fp.readline().rstrip()) + with open(location, 'w') as fp: fp.write(err_str) diff --git a/yaclog/changelog.py b/yaclog/changelog.py index 42e6986..ea1b27e 100644 --- a/yaclog/changelog.py +++ b/yaclog/changelog.py @@ -223,7 +223,7 @@ class Changelog: """ def __init__(self, path=None, - preamble: str = "Changelog\n\nAll notable changes to this project will be documented in this file"): + preamble: str = "# Changelog\n\nAll notable changes to this project will be documented in this file"): """ Contents will be automatically read from disk if the file exists