コード例 #1
0
ファイル: test_changelog.py プロジェクト: kylef/maintain
    def test_disallows_multiple_h1s(self):
        with temp_directory():
            touch('CHANGELOG.md', '# My Changelog\n# Current Release\n')

            with self.assertRaisesRegexp(
                    Exception, 'Changelog has multiple level 1 headings.'):
                parse_changelog('CHANGELOG.md')
コード例 #2
0
ファイル: test_config.py プロジェクト: kylef/maintain
    def test_loading_multiple_file(self):
        with temp_directory():
            touch('.maintain.yaml')
            touch('.maintain.yml')

            with self.assertRaises(Exception):
                Configuration.load()
コード例 #3
0
ファイル: test_changelog.py プロジェクト: kylef/maintain
    def test_disallows_heading_level_jump(self):
        with temp_directory():
            touch('CHANGELOG.md', '# H1\n#### H3\n')

            with self.assertRaisesRegexp(
                    Exception,
                    'Changelog heading level jumps from level 1 to level 4. Must jump one level per heading.'
            ):
                parse_changelog('CHANGELOG.md')
コード例 #4
0
ファイル: test_changelog.py プロジェクト: kylef/maintain
    def test_disallows_heading_level_3_without_release(self):
        with temp_directory():
            touch('CHANGELOG.md', '# H1\n### H3\n')

            with self.assertRaisesRegexp(
                    Exception,
                    'Level 3 heading was not found within a release \(level 2 heading\)'
            ):
                parse_changelog('CHANGELOG.md')
コード例 #5
0
ファイル: test_changelog.py プロジェクト: kylef/maintain
    def test_disallows_missing_h1(self):
        with temp_directory():
            touch('CHANGELOG.md', 'Hello World')

            with self.assertRaisesRegexp(
                    Exception,
                    'Changelog does not start with a level 1 heading, including the changelog name.'
            ):
                parse_changelog('CHANGELOG.md')
コード例 #6
0
ファイル: test_changelog.py プロジェクト: kylef/maintain
    def test_retrieves_only_changelog(self):
        with temp_directory():
            touch(
                'CHANGELOG.md',
                '# My Changelog\n## Current Release\n\nThe Release Information'
            )
            changelog = extract_last_changelog('CHANGELOG.md')

        self.assertEqual(changelog, 'The Release Information')
コード例 #7
0
ファイル: test_config.py プロジェクト: kylef/maintain
 def test_loading_no_file(self):
     with temp_directory():
         configuration = Configuration.load()
         self.assertEqual(configuration.release, {})
コード例 #8
0
ファイル: test_config.py プロジェクト: kylef/maintain
    def test_loading_file_validation(self):
        with temp_directory():
            touch('.maintain.yml', 'release: []')

            with self.assertRaises(Exception):
                configuration.load()
コード例 #9
0
ファイル: test_config.py プロジェクト: kylef/maintain
    def test_loading_file_config_maintain_yaml(self):
        with temp_directory():
            touch('.maintain/config.yaml', 'release:\n  test: {}')

            configuration = Configuration.load()
            self.assertEqual(configuration.release.get('test'), {})