Skip to content

Commit

Permalink
workaround for httpx 0.28 mocker bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult committed Dec 2, 2024
1 parent 01f06b2 commit ae1c4c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/credentials/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from unittest.mock import MagicMock
import motor.motor_asyncio
import jwt
import pytest

import iceprod.credentials.service

Expand Down Expand Up @@ -40,6 +41,7 @@ async def test_credentials_service_refresh_empty(mongo_url, mongo_clear, respx_m
await rs._run_once()


@pytest.mark.respx(using="httpx", assert_all_called=False)
async def test_credentials_service_refresh_not_exp(mongo_url, mongo_clear, respx_mock):
db = motor.motor_asyncio.AsyncIOMotorClient(mongo_url)['creds']
clients = '{}'
Expand All @@ -66,6 +68,7 @@ async def test_credentials_service_refresh_not_exp(mongo_url, mongo_clear, respx
assert rs.last_success_time is not None


@pytest.mark.respx(using="httpx")
async def test_credentials_service_refresh_group(mongo_url, mongo_clear, respx_mock, monkeypatch):
db = motor.motor_asyncio.AsyncIOMotorClient(mongo_url)['creds']
clients = json.dumps({
Expand Down Expand Up @@ -103,6 +106,7 @@ async def test_credentials_service_refresh_group(mongo_url, mongo_clear, respx_m
assert ret['expiration'] == now+1000


@pytest.mark.respx(using="httpx")
async def test_credentials_service_refresh_user(mongo_url, mongo_clear, respx_mock, monkeypatch):
db = motor.motor_asyncio.AsyncIOMotorClient(mongo_url)['creds']
clients = json.dumps({
Expand Down

0 comments on commit ae1c4c3

Please sign in to comment.