示例#1
0
文件: file_test.py 项目: tdolist/tdo
    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.')
示例#2
0
    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.')
示例#3
0
 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)
示例#4
0
 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)