WIP: Add support for updating a headline whole text contents #4
@ -903,7 +903,7 @@ class TestSerde(unittest.TestCase):
|
||||
hl.update_raw_contents(content)
|
||||
|
||||
# Check after update
|
||||
ex.assert_matches(self, hl)
|
||||
ex.assert_matches(self, hl, accept_trailing_whitespace_changes=True)
|
||||
|
||||
|
||||
def print_tree(tree, indentation=0, headline=None):
|
||||
|
@ -58,7 +58,7 @@ class HL:
|
||||
self.content = content
|
||||
self.children = children
|
||||
|
||||
def assert_matches(self, test_case: unittest.TestCase, doc):
|
||||
def assert_matches(self, test_case: unittest.TestCase, doc, accept_trailing_whitespace_changes=False):
|
||||
test_case.assertEqual(self.title, get_raw(doc.title))
|
||||
|
||||
# Check properties
|
||||
@ -75,6 +75,9 @@ class HL:
|
||||
timestamp_to_datetime(doc_props[i].value), prop[1]
|
||||
)
|
||||
|
||||
if accept_trailing_whitespace_changes:
|
||||
test_case.assertEqual(get_raw_contents(doc).rstrip(), self.get_raw().rstrip())
|
||||
else:
|
||||
test_case.assertEqual(get_raw_contents(doc), self.get_raw())
|
||||
|
||||
# Check children
|
||||
|
Loading…
Reference in New Issue
Block a user