27 lines
646 B
Python
27 lines
646 B
Python
import pytest
|
|
from fastapi import Request
|
|
|
|
from src.service.auth.auth import CurrentUser
|
|
from src.service.auth.jwt import Hashes, Jwt
|
|
|
|
|
|
@pytest.fixture
|
|
def current_user_service()->CurrentUser:
|
|
current_user_service=CurrentUser()
|
|
return current_user_service
|
|
|
|
@pytest.fixture
|
|
def jwt_service()->Jwt:
|
|
jwt_service=Jwt()
|
|
return jwt_service
|
|
|
|
@pytest.fixture
|
|
def hash_service()->Hashes:
|
|
hash_service=Hashes()
|
|
return hash_service
|
|
|
|
@pytest.fixture
|
|
def requests(mocker):
|
|
fake_request = mocker.MagicMock(spec=Request)
|
|
fake_request.headers = {"user-agent": "pytest-agent", "x-forwarded-for":"127.0.0.1"}
|
|
return fake_request |