コード例 #1
0
ファイル: test_core.py プロジェクト: twitty-onica/runway
    def test_get_env_vars(self, mock_deployment, runway_config,
                          runway_context):
        """Test get_env_vars."""
        mock_deployment.return_value = mock_deployment
        mock_deployment.env_vars_config = {"key": "val"}
        runway_config.deployments = ["deployment_1"]
        obj = Runway(runway_config, runway_context)

        assert obj.get_env_vars(runway_config.deployments) == {"key": "val"}
        mock_deployment.assert_called_once_with(
            context=runway_context,
            definition="deployment_1",
            variables=runway_config.variables,
        )
コード例 #2
0
    def test_get_env_vars(
        self,
        mocker: MockerFixture,
        runway_config: MockRunwayConfig,
        runway_context: MockRunwayContext,
    ) -> None:
        """Test get_env_vars."""
        mock_deployment = mocker.patch(f"{MODULE}.components.Deployment")
        mock_deployment.return_value = mock_deployment
        mock_deployment.env_vars_config = {"key": "val"}
        runway_config.deployments = ["deployment_1"]
        obj = Runway(runway_config, runway_context)  # type: ignore

        assert obj.get_env_vars(runway_config.deployments) == {
            "key": "val"
        }  # type: ignore
        mock_deployment.assert_called_once_with(
            context=runway_context,
            definition="deployment_1",
            variables=runway_config.variables,
        )