def test_multilist(self): fake_argv = ['../tdo.py', 'export', './test.md', 'Testlist1', 'Testlist2'] todos = todolist.load() todolist.mdexport(todos, fake_argv) shouldstr = '''# Your todos: ## Testlist1 - [ ] Test1 - [ ] Test2 - [ ] Test3 ## Testlist2 - [ ] Test1 - [ ] Test2 - [ ] Test3 ''' isstr = '' with open('./test.md') as mdfile: isstr = mdfile.read() self.assertEqual(shouldstr, isstr, msg='Can not export all lists.')
def test_multilist(self): fake_argv = [ '../tdo.py', 'export', './test.md', 'Testlist1', 'Testlist2' ] todos = todolist.load() todolist.mdexport(todos, fake_argv) shouldstr = '''# Your todos: ## Testlist1 - [ ] Test1 - [ ] Test2 - [ ] Test3 ## Testlist2 - [ ] Test1 - [ ] Test2 - [ ] Test3 ''' isstr = '' with open('./test.md') as mdfile: isstr = mdfile.read() self.assertEqual(shouldstr, isstr, msg='Can not export all lists.')
def test_two(self): from tdo import main todolist.reset() fake_argv = ['../tdo.py', 'add', 'Test1'] main(fake_argv) fake_argv = ['../tdo.py', 'add', 'Test2'] main(fake_argv) fake_argv = ['../tdo.py', 'add', 'Test3'] main(fake_argv) self.assertEqual(todolist.getsettings()['globalid'], 4, msg='The global todo ID incrementation is broken \ (The settings file contains a wrong ID).') todos = todolist.load() self.assertEqual(len(todos['default']), 3, msg='There were not enough/too much entries in lists.\ json.')
def setUp(self): todolist.load() todolist.getsettings()