def test_custom_key_function(self, mock_create):
        """Test that custom key functions generate expected cache keys."""
        ctx = create_mock_ctx()

        store_instance = mock_create.return_value
        store_instance.get.return_value = None  # Simulate cache miss

        result1 = function_with_custom_key(ctx, 2, 3)
        store_instance.get.return_value = result1  # Simulate cache hit
        result2 = function_with_custom_key(ctx, 2, 3)

        self.assertEqual(result1, result2)
        self.assertEqual(result1, 5)

        # Verify that the custom key function was used
        expected_key = _build_cache_key(["custom-key", 2, 3])
        store_instance.get.assert_called_with(expected_key)
        store_instance.set_cache.assert_called_once_with(
            expected_key, result1, ttl=60
        )
Test that custom key functions generate expected cache keys.
tests/unittests/execution_cache/decorator_tests.py