def test_sets_plan_on_deploy(self): config = Mock() config.get_deploy_log = Mock() deployer = Mock() env = Environment(config, "staging", deployer) env.deploy("EXAMPLE-PLAN", "EXAMPLE-PLAN-39") self.assertEquals("EXAMPLE-PLAN", env.get_plan())
def test_lists_environments(self): envs = [ self.__env("vagrant") ] config = Mock() config.get_environments = Mock(return_value=envs) config.get_deploy_log = Mock() envs = Environments(config) self.assertEquals(1, len(envs.list()))
def test_sets_build_on_deploy(self): config = Mock() config.get_deploy_log = Mock() deployer = Mock() env = Environment(config, "vagrant", deployer) env.deploy("EXAMPLE-PLAN", "EXAMPLE-PLAN-56") self.assertEquals("EXAMPLE-PLAN-56", env.get_build())
def test_gets_log_from_config(self): config = Mock() config.get_deploy_log = Mock(return_value="/tmp/deploy.log") tail = Tail(config) tail.get_data = Mock() tail.get() tail.get_data.assert_called_with("/tmp/deploy.log")
def test_deploys_with_expected_arguments(self): config = Mock() config.get_deploy_log = Mock(return_value="/tmp/deploy.log") env = Environment(config, "production", "wget") env.deployer = Mock() env.deployer.deploy = Mock() env.deploy("EXAMPLE-PLAN", "EXAMPLE-PLAN-123") env.deployer.deploy.assert_called_with("EXAMPLE-PLAN-123", "/tmp/deploy.log")