def test_scan_dict_values_executes_value_handler_for_all_matching_prefixes(self):
        dictionary = {'a': 'foo123', 'b': {'c': 'foo234'}}
        handler = Mock()
        handler.return_value = "foo"

        result = CloudFormationTemplateTransformer.scan_dict_values(dictionary, handler)
        expected_calls = [mock.call('foo123'), mock.call('foo234')]
        six.assertCountEqual(self, expected_calls, handler.mock_calls)
        six.assertCountEqual(self, result, {'a': 'foo', 'b': {'c': 'foo'}})
    def test_scan_dict_values_executes_value_handler_for_all_matching_prefixes(
            self):
        dictionary = {'a': 'foo123', 'b': {'c': 'foo234'}}
        handler = Mock()
        handler.return_value = "foo"

        result = CloudFormationTemplateTransformer.scan_dict_values(
            dictionary, handler)
        expected_calls = [mock.call('foo123'), mock.call('foo234')]
        six.assertCountEqual(self, expected_calls, handler.mock_calls)
        six.assertCountEqual(self, result, {'a': 'foo', 'b': {'c': 'foo'}})