forked from kenkeiras/org-rw
Close PROPERTY drawers when there's no empty lines between headlines.
This commit is contained in:
parent
a164653cd0
commit
bd57dff091
4 changed files with 52 additions and 0 deletions
6
tests/08-property-creation.org
Normal file
6
tests/08-property-creation.org
Normal file
|
@ -0,0 +1,6 @@
|
|||
#+TITLE: 08-Property-creation
|
||||
|
||||
* Top headline
|
||||
** Second headline
|
||||
|
||||
*** Third headline
|
|
@ -507,3 +507,32 @@ class TestSerde(unittest.TestCase):
|
|||
hl = doc.getTopHeadlines()[0]
|
||||
self.assertEqual(hl.get_property("ID"), "419f4651-21c8-4166-b8d5-692c34be9f93")
|
||||
self.assertEqual(len(hl.children), 1)
|
||||
|
||||
def test_org_property_creation_08(self):
|
||||
with open(os.path.join(DIR, "08-property-creation.org")) as f:
|
||||
orig = f.read()
|
||||
doc = loads(orig)
|
||||
|
||||
headline = doc.getTopHeadlines()[0]
|
||||
headline.id = "first"
|
||||
|
||||
second = headline.children[0]
|
||||
second.id = "second"
|
||||
|
||||
self.assertEqual(
|
||||
dumps(doc).strip(),
|
||||
"""
|
||||
#+TITLE: 08-Property-creation
|
||||
|
||||
* Top headline
|
||||
:PROPERTIES:
|
||||
:ID: first
|
||||
:END:
|
||||
** Second headline
|
||||
:PROPERTIES:
|
||||
:ID: second
|
||||
:END:
|
||||
|
||||
*** Third headline
|
||||
""".strip(),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue