MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / test_auth_flow

Function test_auth_flow

tests/integration/test_auth_flow.py:18–36  ·  view source on GitHub ↗

Test the authentication flow using the AgentOps client.

(mock_api_key)

Source from the content-addressed store, hash-verified

16
17@pytest.mark.vcr()
18def test_auth_flow(mock_api_key):
19 """Test the authentication flow using the AgentOps client."""
20 with patch("agentops.client.client.ApiClient") as mock_api_client:
21 # Create mock API instance
22 mock_api = MagicMock()
23 mock_api.v3.fetch_auth_token.return_value = {"token": "mock_token", "project_id": "mock_project_id"}
24 mock_api_client.return_value = mock_api
25
26 # Initialize the client
27 client = Client()
28 session = client.init(api_key=mock_api_key)
29
30 # Verify client is initialized
31 assert client.initialized
32 assert client.api is not None
33
34 # Verify session is created if auto_start_session is True
35 if client.config.auto_start_session:
36 assert session is not None
37
38
39@pytest.mark.vcr()

Callers

nothing calls this directly

Calls 2

initMethod · 0.95
ClientClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…