Add TODO keywords programmatically #2

Merged
kenkeiras merged 6 commits from feat/add-todo-keywords-programmatically into develop 2024-07-29 14:34:19 +00:00
Showing only changes of commit 4c169f5d47 - Show all commits

View File

@ -797,6 +797,23 @@ class TestSerde(unittest.TestCase):
def test_add_todo_keywords_programatically(self): def test_add_todo_keywords_programatically(self):
orig = '''* NEW_TODO_STATE First entry 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 test_add_todo_keywords_in_file(self):
orig = '''#+TODO: NEW_TODO_STATE | NEW_DONE_STATE
* NEW_TODO_STATE First entry
* NEW_DONE_STATE Second entry''' * NEW_DONE_STATE Second entry'''
doc = loads(orig, environment={ doc = loads(orig, environment={
'org-todo-keywords': "NEW_TODO_STATE | NEW_DONE_STATE" 'org-todo-keywords': "NEW_TODO_STATE | NEW_DONE_STATE"