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.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) fake_argv = ['../tdo.py', 'newlist', 'Testlist1'] main(fake_argv) fake_argv = ['../tdo.py', 'add', 'Test1', 'Testlist1'] main(fake_argv) fake_argv = ['../tdo.py', 'add', 'Test2', 'Testlist1'] main(fake_argv) fake_argv = ['../tdo.py', 'add', 'Test3', 'Testlist1'] main(fake_argv) fake_argv = ['../tdo.py', 'newlist', 'Testlist2'] main(fake_argv) fake_argv = ['../tdo.py', 'add', 'Test1', 'Testlist2'] main(fake_argv) fake_argv = ['../tdo.py', 'add', 'Test2', 'Testlist2'] main(fake_argv) fake_argv = ['../tdo.py', 'add', 'Test3', 'Testlist2'] main(fake_argv)