From f4d63c2f932d4787b4624dde7168073844b65468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Sat, 20 Jul 2024 14:41:04 +0200 Subject: [PATCH] Add (failing) test. --- tests/test_org.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_org.py b/tests/test_org.py index 8631fba..0a4acc7 100644 --- a/tests/test_org.py +++ b/tests/test_org.py @@ -794,6 +794,21 @@ class TestSerde(unittest.TestCase): self.assertEqual(dumps(doc), orig) + def test_add_todo_keywords_programatically(self): + orig = '''* NEW_TODO_STATE First entry + +* NEW_DONE_STATE Second entry''' + doc = loads(orig, environment={ + 'org-todo-keywords': "NEW_TODO_STATE | NEW_DONE_STATE" + }) + self.assertEqual(doc.headlines[0].is_todo, True) + self.assertEqual(doc.headlines[0].is_done, False) + + self.assertEqual(doc.headlines[1].is_todo, False) + self.assertEqual(doc.headlines[1].is_done, True) + + self.assertEqual(dumps(doc), orig) + def print_tree(tree, indentation=0, headline=None): for element in tree: