Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangomez24 committed Nov 7, 2024
1 parent b0aafd6 commit 3725a48
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cdp-agentkit-core/cdp_agentkit_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from cdp_agentkit_core import __version__
from cdp_agentkit_core.__version__ import __version__

__all__ = [
"__version__"
Expand Down
2 changes: 1 addition & 1 deletion cdp-langchain/cdp_langchain/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from cdp_langchain import __version__
from cdp_langchain.__version__ import __version__

__all__ = ["__version__"]
17 changes: 14 additions & 3 deletions cdp-langchain/tests/utils/test_cdp_agentkit_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
from pydantic import ValidationError

from cdp import Cdp, Wallet, WalletData
from cdp_langchain import __version__
from cdp_langchain.utils import CdpAgentkitWrapper
from cdp_langchain.constants import CDP_LANGCHAIN_DEFAULT_SOURCE


@pytest.fixture
Expand Down Expand Up @@ -62,7 +64,10 @@ def test_initialization_with_env_vars(
assert wrapper.wallet is not None

mock_cdp_configure.assert_called_once_with(
env_vars["CDP_API_KEY_NAME"], env_vars["CDP_API_KEY_PRIVATE_KEY"]
api_key_name=env_vars["CDP_API_KEY_NAME"],
private_key=env_vars["CDP_API_KEY_PRIVATE_KEY"],
source=CDP_LANGCHAIN_DEFAULT_SOURCE,
source_version=__version__,
)

mock_wallet_create.assert_called_once_with(network_id=env_vars["NETWORK_ID"])
Expand All @@ -83,7 +88,10 @@ def test_initialization_with_direct_values(mock_cdp_configure: Mock, mock_wallet
assert wrapper.network_id == test_values["network_id"]

mock_cdp_configure.assert_called_once_with(
test_values["cdp_api_key_name"], test_values["cdp_api_key_private_key"]
api_key_name=test_values["cdp_api_key_name"],
private_key=test_values["cdp_api_key_private_key"],
source=CDP_LANGCHAIN_DEFAULT_SOURCE,
source_version=__version__,
)

mock_wallet_create.assert_called_once_with(network_id=test_values["network_id"])
Expand All @@ -110,7 +118,10 @@ def test_initialization_with_direct_values_and_persisted_wallet(
assert wrapper.network_id == test_values["network_id"]

mock_cdp_configure.assert_called_once_with(
test_values["cdp_api_key_name"], test_values["cdp_api_key_private_key"]
api_key_name=test_values["cdp_api_key_name"],
private_key=test_values["cdp_api_key_private_key"],
source=CDP_LANGCHAIN_DEFAULT_SOURCE,
source_version=__version__,
)

mock_wallet_import_data.assert_called_once()
Expand Down

0 comments on commit 3725a48

Please sign in to comment.