def test_scan_dict_keys_executes_key_handler_for_all_matching_keys(self):
        dictionary = {'key': 'value'}
        handler = Mock()
        handler.return_value = 'new-key', 'new-value'

        result = CloudFormationTemplateTransformer.scan_dict_keys(dictionary, handler)
        expected_calls = [mock.call('key', 'value')]

        six.assertCountEqual(self, expected_calls, handler.mock_calls)
        self.assertDictEqual(result, {'new-key': 'new-value'})
    def test_scan_dict_keys_executes_key_handler_for_all_matching_keys(self):
        dictionary = {'key': 'value'}
        handler = Mock()
        handler.return_value = 'new-key', 'new-value'

        result = CloudFormationTemplateTransformer.scan_dict_keys(
            dictionary, handler)
        expected_calls = [mock.call('key', 'value')]

        six.assertCountEqual(self, expected_calls, handler.mock_calls)
        self.assertDictEqual(result, {'new-key': 'new-value'})