Exemplo n.º 1
0
 def test_delete_empty_sprint(self):
     self._init_test_data(4, True)
     sprintDocStub.set_expected_check_result('unavailable', 'unavailable')
     self.sprint.delete()
     osStub.check_rmtree_called(self.sprintName)
     sprintDocStub.check_initialized_result([])
     sysOutputStub.check_sys_output("{0} is: new\n{0} deleted\n".format(self.sprintName))
Exemplo n.º 2
0
 def test_delete_worked_sprint(self):
     self._init_test_data(4, True)
     sprintDocStub.set_expected_check_result('worked', 'unavailable')
     self.sprint.delete()
     osStub.check_rmtree_called('')
     sprintDocStub.check_initialized_result([])
     sysOutputStub.check_sys_output("{0} is: worked\nDelete FORBIDDEN!\n".format(self.sprintName))
Exemplo n.º 3
0
 def test_initialize_exist_sprint(self):
     self._init_test_data(10, True)
     self.sprint.initialize()
     osStub.check_dir_created(self.sprintName)
     sysOutputStub.check_sys_output(self.sprintName+" exist, can't be initialized\n")
     sprintDocStub.check_initialized_result([])
     self.assertEqual("", osStub.curDir)
Exemplo n.º 4
0
 def _do_initialize(self, sprintNum=0):
     self._init_test_data(sprintNum, False)
     self.sprint.initialize()
     osStub.check_dir_created(self.sprintName)
     sysOutputStub.check_sys_output(self.sprintName + " created\n")
     sprintDocStub.check_initialized_result(sprintDir.fileList)
     self.assertEqual("", osStub.curDir)
Exemplo n.º 5
0
 def _do_check(self, state):
     self.sprint.check()
     stateStr=self.sprintName+' is: '+state+'\n'
     sysOutputStub.check_sys_output(stateStr)
     self.assertEqual("", osStub.curDir)
Exemplo n.º 6
0
 def _initialize_doc_test(self, fname):
     self.doc = sprintDoc(fname)
     self.doc.initialize()
     fileIoStub.check_created_files(fname, sprintDoc.templates[fname])
     sysOutputStub.check_sys_output("- "+fname+" created\n")
Exemplo n.º 7
0
 def _print_help_check(self):
     sprint_main()
     sprintDirStub.check_objs_created()
     sprintDirStub.check_called()
     sysOutputStub.check_sys_output(helpString+'\n')
Exemplo n.º 8
0
 def test_delete_not_exist_sprint(self):
     self._init_test_data(0)
     self.sprint.delete()
     osStub.check_rmtree_called("")
     sysOutputStub.check_sys_output("{0} is: unavailable\n".format(self.sprintName))
Exemplo n.º 9
0
 def test_delete_new_sprint(self):
     self._init_test_data(1, True)
     sprintDocStub.set_expected_check_result('new', 'new')
     self.sprint.delete()
     osStub.check_rmtree_called(self.sprintName)
     sysOutputStub.check_sys_output("{0} is: new\n{0} deleted\n".format(self.sprintName))