Skip to content

Commit

Permalink
feat: Updated agents-api/agents_api/common/utils/c
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Apr 13, 2024
1 parent 66cc905 commit fa356d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions agents-api/agents_api/common/utils/cozo.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
#!/usr/bin/env python3

"""This module provides utility functions for interacting with the Cozo API client, including data mutation processes."""

from types import SimpleNamespace

from pycozo import Client

# Define a mock client for testing purposes, simulating Cozo API client behavior.
_fake_client = SimpleNamespace()
# Lambda function to process and mutate data dictionaries using the Cozo client's internal method. This is a workaround to access protected member functions for testing.
_fake_client._process_mutate_data_dict = lambda data: (
Client._process_mutate_data_dict(_fake_client, data)
)

# Public interface to process and mutate data using the Cozo client. It wraps the client's internal processing method for external use.
cozo_process_mutate_data = _fake_client._process_mutate_data = lambda data: (
Client._process_mutate_data(_fake_client, data)
)

0 comments on commit fa356d8

Please sign in to comment.