forked from kenkeiras/org-rw
Add tests and implement org-tags-exclude-from-inheritance
.
This commit is contained in:
parent
852f472374
commit
92078617fc
2 changed files with 27 additions and 2 deletions
|
@ -906,6 +906,25 @@ class TestSerde(unittest.TestCase):
|
|||
h1_2_h2 = h1_2.children[0]
|
||||
self.assertEqual(sorted(h1_2_h2.shallow_tags), ['otherh2tag'])
|
||||
|
||||
def test_exclude_tags_from_inheritance_property_read_13(self):
|
||||
with open(os.path.join(DIR, "13-tags.org")) as f:
|
||||
orig = f.read()
|
||||
doc = loads(orig, {
|
||||
'org-tags-exclude-from-inheritance': ('h1tag', 'otherh2tag')
|
||||
})
|
||||
|
||||
self.assertEqual(doc.tags, ['filetag'])
|
||||
|
||||
h1_1, h1_2 = doc.getTopHeadlines()
|
||||
self.assertEqual(sorted(h1_1.tags), ['filetag', 'h1tag'])
|
||||
self.assertEqual(sorted(h1_2.tags), ['filetag', 'otherh1tag'])
|
||||
|
||||
h1_1_h2 = h1_1.children[0]
|
||||
self.assertEqual(sorted(h1_1_h2.tags), ['filetag', 'h2tag'])
|
||||
|
||||
h1_2_h2 = h1_2.children[0]
|
||||
self.assertEqual(sorted(h1_2_h2.tags), ['filetag', 'otherh1tag', 'otherh2tag'])
|
||||
|
||||
def print_tree(tree, indentation=0, headline=None):
|
||||
for element in tree:
|
||||
print(" " * indentation * 2, "EL:", element)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue