Ejemplo n.º 1
0
 def testShouldFailOnRunPreDeploymentWhenRunSecondTask(self):
     # GIVEN
     self.mkdir_task_one.doTask.return_value = True
     self.mkdir_task_two.doTask.return_value = False
     pre_deploy_task_list = [self.mkdir_task_one, self.mkdir_task_one]
     pre_deployment = PreDeployment(pre_deploy_task_list)
     # WHEN
     ran_successfully = pre_deployment.run()
     # THEN
     self.mkdir_task_one.doTask.assert_called_once
     self.mkdir_task_two.doTask.call_count == 0
     self.assertTrue("A new PreDeploymentRequest was not created successfully!", ran_successfully)        
Ejemplo n.º 2
0
 def testShouldRunPreDeploymentOnceHavingListOfMkdirTasksSuccessfully(self):
     # GIVEN
     self.mkdir_task_one.doTask.return_value = True
     self.mkdir_task_two.doTask.return_value = True
     pre_deploy_task_list = [self.mkdir_task_one, self.mkdir_task_one]
     pre_deployment = PreDeployment(pre_deploy_task_list)
     # WHEN
     ran_successfully = pre_deployment.run()
     # THEN
     self.mkdir_task_one.doTask.assert_called_once
     self.mkdir_task_two.doTask.assert_called_once
     self.assertTrue("A new PreDeploymentRequest was not created successfully!", ran_successfully)
Ejemplo n.º 3
0
 def testShouldFailOnRunPreDeploymentWhenRunSecondTask(self):
     # GIVEN
     self.mkdir_task_one.doTask.return_value = True
     self.mkdir_task_two.doTask.return_value = False
     pre_deploy_task_list = [self.mkdir_task_one, self.mkdir_task_one]
     pre_deployment = PreDeployment(pre_deploy_task_list)
     # WHEN
     ran_successfully = pre_deployment.run()
     # THEN
     self.mkdir_task_one.doTask.assert_called_once
     self.mkdir_task_two.doTask.call_count == 0
     self.assertTrue(
         "A new PreDeploymentRequest was not created successfully!",
         ran_successfully)
Ejemplo n.º 4
0
 def testShouldRunPreDeploymentOnceHavingListOfMkdirTasksSuccessfully(self):
     # GIVEN
     self.mkdir_task_one.doTask.return_value = True
     self.mkdir_task_two.doTask.return_value = True
     pre_deploy_task_list = [self.mkdir_task_one, self.mkdir_task_one]
     pre_deployment = PreDeployment(pre_deploy_task_list)
     # WHEN
     ran_successfully = pre_deployment.run()
     # THEN
     self.mkdir_task_one.doTask.assert_called_once
     self.mkdir_task_two.doTask.assert_called_once
     self.assertTrue(
         "A new PreDeploymentRequest was not created successfully!",
         ran_successfully)
Ejemplo n.º 5
0
 def testShouldBeAbleCreateANewPreDeploymentRequest(self):
     pre_deployment = PreDeployment([])
     assert pre_deployment != None, "A new PreDeploymentRequest was not created successfully!"