def test_deploy(self, mock_action, cfngin_fixtures, tmp_path): """Test deploy with two files & class init.""" mock_instance = self.configure_mock_action_instance(mock_action) copy_basic_fixtures(cfngin_fixtures, tmp_path) copy_fixture(src=cfngin_fixtures / 'configs' / 'basic.yml', dest=tmp_path / 'basic2.yml') context = self.get_context() context.env_vars['CI'] = '1' cfngin = CFNgin(ctx=context, parameters={'test_param': 'test-param-value'}, sys_path=str(tmp_path)) # support python < 3.6 cfngin.deploy() assert cfngin.concurrency == 0 assert not cfngin.interactive assert cfngin.parameters.bucket_name == 'cfngin-bucket' assert cfngin.parameters.environment == 'test' assert cfngin.parameters.namespace == 'test-namespace' assert cfngin.parameters.region == 'us-east-1' assert cfngin.parameters.test_key == 'test_value' assert cfngin.parameters.test_param == 'test-param-value' assert cfngin.recreate_failed assert cfngin.region == 'us-east-1' assert cfngin.sys_path == str(tmp_path) assert not cfngin.tail assert mock_action.call_count == 2 mock_instance.execute.has_calls([{'concurrency': 0, 'tail': False}, {'concurrency': 0, 'tail': False}])
def test_deploy(self, mock_action, cfngin_fixtures, tmp_path, patch_safehaven): """Test deploy with two files & class init.""" mock_instance = self.configure_mock_action_instance(mock_action) copy_basic_fixtures(cfngin_fixtures, tmp_path) copy_fixture( src=cfngin_fixtures / "configs" / "basic.yml", dest=tmp_path / "basic2.yml" ) context = self.get_context() context.env_vars["CI"] = "1" cfngin = CFNgin( ctx=context, parameters={"test_param": "test-param-value"}, sys_path=str(tmp_path), ) # support python < 3.6 cfngin.deploy() assert cfngin.concurrency == 0 assert not cfngin.interactive assert cfngin.parameters.bucket_name == "cfngin-bucket" assert cfngin.parameters.environment == "test" assert cfngin.parameters.namespace == "test-namespace" assert cfngin.parameters.region == "us-east-1" assert cfngin.parameters.test_key == "test_value" assert cfngin.parameters.test_param == "test-param-value" assert cfngin.recreate_failed assert cfngin.region == "us-east-1" assert cfngin.sys_path == str(tmp_path) assert not cfngin.tail assert mock_action.call_count == 2 mock_instance.execute.has_calls( [{"concurrency": 0, "tail": False}, {"concurrency": 0, "tail": False}] ) patch_safehaven.assert_has_calls( [ call( environ=context.env_vars, sys_modules_exclude=["awacs", "troposphere"], ), call.__enter__(), call( argv=["stacker", "build", str(tmp_path / "basic.yml")], sys_modules_exclude=["awacs", "troposphere"], ), call.__enter__(), call.__exit__(None, None, None), call( argv=["stacker", "build", str(tmp_path / "basic2.yml")], sys_modules_exclude=["awacs", "troposphere"], ), call.__enter__(), call.__exit__(None, None, None), call.__exit__(None, None, None), ] )
def test_deploy(self, mock_action, cfngin_fixtures, tmp_path, patch_safehaven): """Test deploy with two files & class init.""" mock_instance = self.configure_mock_action_instance(mock_action) copy_basic_fixtures(cfngin_fixtures, tmp_path) copy_fixture(src=cfngin_fixtures / 'configs' / 'basic.yml', dest=tmp_path / 'basic2.yml') context = self.get_context() context.env_vars['CI'] = '1' cfngin = CFNgin(ctx=context, parameters={'test_param': 'test-param-value'}, sys_path=str(tmp_path)) # support python < 3.6 cfngin.deploy() assert cfngin.concurrency == 0 assert not cfngin.interactive assert cfngin.parameters.bucket_name == 'cfngin-bucket' assert cfngin.parameters.environment == 'test' assert cfngin.parameters.namespace == 'test-namespace' assert cfngin.parameters.region == 'us-east-1' assert cfngin.parameters.test_key == 'test_value' assert cfngin.parameters.test_param == 'test-param-value' assert cfngin.recreate_failed assert cfngin.region == 'us-east-1' assert cfngin.sys_path == str(tmp_path) assert not cfngin.tail assert mock_action.call_count == 2 mock_instance.execute.has_calls([{ 'concurrency': 0, 'tail': False }, { 'concurrency': 0, 'tail': False }]) patch_safehaven.assert_has_calls([ call(environ=context.env_vars, sys_modules_exclude=['awacs', 'troposphere']), call.__enter__(), call(argv=['stacker', 'build', str(tmp_path / 'basic.yml')], sys_modules_exclude=['awacs', 'troposphere']), call.__enter__(), call.__exit__(None, None, None), call(argv=['stacker', 'build', str(tmp_path / 'basic2.yml')], sys_modules_exclude=['awacs', 'troposphere']), call.__enter__(), call.__exit__(None, None, None), call.__exit__(None, None, None), ])