Ejemplo n.º 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))
Ejemplo n.º 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)
Ejemplo n.º 3
0
 def test_deploy_environment_action(self, deploy):
     self.deploy_environment = tables.DeployEnvironment()
     self.deploy_environment.action("", '')
     self.assertTrue(deploy.called)
Ejemplo n.º 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("", ""))