コード例 #1
0
    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())
コード例 #2
0
    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())
コード例 #3
0
    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")