Add (failing) test

This commit is contained in:
Sergio Martínez Portela 2023-10-16 23:32:18 +02:00
parent e4821f02cd
commit 9d87d533f4
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,22 @@
#+TITLE: 12-Headlines with skip levels
#+DESCRIPTION: Simple org file to test Headlines with skip levels
#+TODO: TODO(t) PAUSED(p) | DONE(d)
* Level 1
:PROPERTIES:
:ID: 12-headlines-with-skip-levels
:CREATED: [2020-01-01 Wed 01:01]
:END:
*** Level 3
*** Level 3-2
* Level 1-2
** Level 2
**** Level 4
*** Level3

View File

@ -757,6 +757,13 @@ class TestSerde(unittest.TestCase):
self.assertEqual(children[3].children[0].content, ['2.1'])
self.assertEqual(children[3].children[1].content, ['2.2'])
def test_mimic_write_file_12(self):
with open(os.path.join(DIR, "12-headlines-with-skip-levels.org")) as f:
orig = f.read()
doc = loads(orig)
self.assertEqual(dumps(doc), orig)
def print_tree(tree, indentation=0, headline=None):
for element in tree: