mirror of
https://github.com/vale981/releases
synced 2025-03-06 10:11:42 -05:00
Refactor assertions & add failing test re: changelog name
This commit is contained in:
parent
d5b652dd3c
commit
ef08cabbdc
1 changed files with 16 additions and 8 deletions
|
@ -499,6 +499,14 @@ def _doctree(name='changelog'):
|
||||||
doctree.append(source)
|
doctree.append(source)
|
||||||
return doctree
|
return doctree
|
||||||
|
|
||||||
|
def _assert_changlogged(doctree):
|
||||||
|
header, issues = doctree[0][1]
|
||||||
|
assert '<h2' in str(header)
|
||||||
|
assert '1.0.2' in str(header)
|
||||||
|
assert isinstance(issues, bullet_list)
|
||||||
|
assert isinstance(issues[0], list_item)
|
||||||
|
assert '27' in str(issues[0])
|
||||||
|
|
||||||
|
|
||||||
class integration(Spec):
|
class integration(Spec):
|
||||||
"""
|
"""
|
||||||
|
@ -506,13 +514,13 @@ class integration(Spec):
|
||||||
"""
|
"""
|
||||||
def full_changelog_build_no_kaboom(self):
|
def full_changelog_build_no_kaboom(self):
|
||||||
# Make a changelog 'page'
|
# Make a changelog 'page'
|
||||||
doctree = _doctree()
|
doc = _doctree()
|
||||||
# Parse it
|
# Parse it
|
||||||
generate_changelog(_app(), doctree)
|
generate_changelog(_app(), doc)
|
||||||
# Expect that it has been modified (lol side effects)
|
# Expect that it has been modified (lol side effects)
|
||||||
header, issues = doctree[0][1]
|
_assert_changlogged(doc)
|
||||||
assert '<h2' in str(header)
|
|
||||||
assert '1.0.2' in str(header)
|
def configurable_document_name(self):
|
||||||
assert isinstance(issues, bullet_list)
|
doc = _doctree('notchangelog')
|
||||||
assert isinstance(issues[0], list_item)
|
generate_changelog(_app(), doc)
|
||||||
assert '27' in str(issues[0])
|
_assert_changlogged(doc)
|
||||||
|
|
Loading…
Add table
Reference in a new issue