Refactor assertions & add failing test re: changelog name

This commit is contained in:
Jeff Forcier 2014-04-03 14:14:24 -07:00
parent d5b652dd3c
commit ef08cabbdc

View file

@ -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)