Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 03:37 UTC
| 1 | """Tests for ``composio.keyring``.""" |
| 2 | |
| 3 | from unittest.mock import Mock |
| 4 | |
| 5 | import pytest |
| 6 | |
| 7 | from composio.core.models.keyring import Keyring |
| 8 | from tests.conftest import mock_http_client |
| 9 | |
| 10 | |
| 11 | @pytest.fixture |
| 12 | def mock_client() -> Mock: |
| 13 | client = mock_http_client() |
| 14 | client.keyring = Mock() |
| 15 | return client |
| 16 | |
| 17 | |
| 18 | def test_list_transfer_keys_delegates_to_client(mock_client): |
| 19 | mock_client.keyring.list_transfer_keys.return_value = "transfer-keys" |
| 20 | |
| 21 | result = Keyring(client=mock_client).list_transfer_keys() |
| 22 | |
| 23 | assert result == "transfer-keys" |
| 24 | mock_client.keyring.list_transfer_keys.assert_called_once_with() |