Skip to content

Commit

Permalink
mock_req in higher level
Browse files Browse the repository at this point in the history
  • Loading branch information
teocns committed Nov 27, 2024
1 parent 6788e46 commit b0f7e7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import pytest
import requests_mock
from unittest import mock

# from agentops.http_client import HttpStatus, Response
# @pytest.fixture(autouse=True)
# @pytest.fixture(autouse=True, scope="session")
# def mock_http_client():
# # Mock the batch method specifically
# with mock.patch("agentops.http_client.HttpClient.post") as mock_post:
Expand Down
13 changes: 0 additions & 13 deletions tests/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,6 @@ def test_session_timing(self, mock_time):
"""


@pytest.fixture(autouse=True, scope="function")
def mock_req():
with requests_mock.Mocker() as m:
url = "https://api.agentops.ai"
m.post(url + "/v2/create_events", json={"status": "ok"})
m.post(url + "/v2/create_session", json={"status": "success", "jwt": "some_jwt"})
m.post(url + "/v2/reauthorize_jwt", json={"status": "success", "jwt": "some_jwt"})
m.post(url + "/v2/update_session", json={"status": "success", "token_cost": 5})
m.post(url + "/v2/developer_errors", json={"status": "ok"})
m.post("https://pypi.org/pypi/agentops/json", status_code=404)
yield m


class TestNonInitializedSessions:
def setup_method(self):
self.api_key = "11111111-1111-4111-8111-111111111111"
Expand Down

0 comments on commit b0f7e7e

Please sign in to comment.