class TestStackOutputExternalResolver(object): def setup_method(self, test_method): self.stack_output_resolver = StackOutputExternal( environment_config=sentinel.environment_config, stack_config=sentinel.config, connection_manager=sentinel.connection_manager, argument=None ) @patch( "sceptre.resolvers.stack_output.StackOutputExternal._get_output_value" ) def test_resolve(self, mock_get_output_value): mock_environment_config = MagicMock(spec=Config) mock_environment_config.__getitem__.return_value = "project-code" mock_environment_config.environment_path = "account/dev" self.stack_output_resolver.environment_config = mock_environment_config self.stack_output_resolver.argument = "vpc::VpcId" mock_get_output_value.return_value = "output_value" self.stack_output_resolver.resolve() mock_get_output_value.assert_called_once_with( "vpc", "VpcId" )
def setup_method(self, test_method): self.stack_output_resolver = StackOutputExternal( environment_config=sentinel.environment_config, stack_config=sentinel.config, connection_manager=sentinel.connection_manager, argument=None )
def test_resolve(self, mock_get_output_value): stack = MagicMock(spec=Stack) stack.dependencies = [] stack._connection_manager = MagicMock(spec=ConnectionManager) stack_output_external_resolver = StackOutputExternal( "another/account-vpc::VpcId", stack) mock_get_output_value.return_value = "output_value" stack_output_external_resolver.resolve() mock_get_output_value.assert_called_once_with("another/account-vpc", "VpcId", None) assert stack.dependencies == []