예제 #1
0
    def test_deploy_environment_is_allowed_with_environment(self, deployed):
        self.deploy_environment = tables.DeployEnvironment()
        deployed.return_value = True
        test_environment = mock.Mock()
        test_environment.status = "pending"
        self.assertTrue(self.deploy_environment.allowed("", test_environment))

        deployed.return_value = False
        self.assertTrue(self.deploy_environment.allowed("", test_environment))

        test_environment.status = "test"
        self.assertFalse(self.deploy_environment.allowed("", test_environment))
예제 #2
0
 def test_deploy_environment_action_fail(self, exceptions, reverse):
     self.deploy_environment = tables.DeployEnvironment()
     exceptions.handle.return_value = ""
     self.deploy_environment.action("", "")
     self.assertTrue(reverse.called)
예제 #3
0
 def test_deploy_environment_action(self, deploy):
     self.deploy_environment = tables.DeployEnvironment()
     self.deploy_environment.action("", '')
     self.assertTrue(deploy.called)
예제 #4
0
 def test_deploy_environment_is_allowed_without_environment(self, actions):
     self.deploy_environment = tables.DeployEnvironment()
     actions.return_value = True
     self.assertTrue(self.deploy_environment.allowed("", ""))