Exemplo n.º 1
0
 def test_cdk_list_empty(
     self,
     fake_process: FakeProcess,
     mocker: MockerFixture,
     runway_context: RunwayContext,
     tmp_path: Path,
 ) -> None:
     """Test cdk_list empty."""
     mock_gen_cmd = mocker.patch.object(CloudDevelopmentKit,
                                        "gen_cmd",
                                        return_value=["list"])
     fake_process.register_subprocess(mock_gen_cmd.return_value,
                                      returncode=0,
                                      stdout="")
     obj = CloudDevelopmentKit(runway_context, module_root=tmp_path)
     assert obj.cdk_list() == [""]
     assert fake_process.call_count(mock_gen_cmd.return_value) == 1
Exemplo n.º 2
0
 def test_cdk_list(
     self,
     fake_process: FakeProcess,
     mocker: MockerFixture,
     runway_context: RunwayContext,
     tmp_path: Path,
 ) -> None:
     """Test cdk_list."""
     mock_gen_cmd = mocker.patch.object(CloudDevelopmentKit,
                                        "gen_cmd",
                                        return_value=["list"])
     fake_process.register_subprocess(mock_gen_cmd.return_value,
                                      returncode=0,
                                      stdout="Stack0\nStack1")
     obj = CloudDevelopmentKit(runway_context, module_root=tmp_path)
     assert obj.cdk_list() == ["Stack0", "Stack1"]
     mock_gen_cmd.assert_called_once_with("list", include_context=True)
     assert fake_process.call_count(mock_gen_cmd.return_value) == 1