Skip to content

Commit

Permalink
feat: add types
Browse files Browse the repository at this point in the history
  • Loading branch information
Angel-Dijoux committed Jan 1, 2024
1 parent d64cf27 commit c0c0c1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from unittest.mock import MagicMock, patch
from unittest.mock import _Mock, MagicMock, patch

import pytest
from src.business_logic.formation.exceptions import NoOnisepAPIException
Expand All @@ -19,7 +19,7 @@ def mock_onisep_request():
yield mock_requests_get


def test_get_onisep_data_successful(mock_onisep_request):
def test_get_onisep_data_successful(mock_onisep_request: _Mock):
# Arrange
mock_response = MagicMock()
mock_response.status_code = HTTP_200_OK
Expand All @@ -31,7 +31,7 @@ def test_get_onisep_data_successful(mock_onisep_request):
assert result == {"total": "5173"}


def test_get_onisep_data_retry_after_unauthorized(mock_onisep_request):
def test_get_onisep_data_retry_after_unauthorized(mock_onisep_request: _Mock):
# Arrange
unauthorized_response = MagicMock()
unauthorized_response.status_code = HTTP_401_UNAUTHORIZED
Expand All @@ -49,7 +49,7 @@ def test_get_onisep_data_retry_after_unauthorized(mock_onisep_request):
assert result == {"total": "5173"}


def test_get_onisep_data_raises_exception(mock_onisep_request):
def test_get_onisep_data_raises_exception(mock_onisep_request: _Mock):
# Arrange
mock_response = MagicMock()
mock_response.status_code = HTTP_500_INTERNAL_SERVER_ERROR
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from unittest.mock import patch
from unittest.mock import patch, _Mock

import pytest
from src.business_logic.formation.scrap.search_formation import (
Expand Down Expand Up @@ -52,7 +52,7 @@ def mock_search_formations():


def test_search_formations_should_return_formations_without_favorite(
mock_search_formations,
mock_search_formations: _Mock,
):
# Arrange
mock_search_formations.return_value = MOKED_RESEARCH
Expand All @@ -72,7 +72,7 @@ def test_search_formations_should_return_formations_without_favorite(


def test_authenticated_search_formations_should_return_formations_with_favorite(
mock_search_formations, db_session
mock_search_formations: _Mock, db_session
):
# Arrange
mock_search_formations.return_value = MOKED_RESEARCH
Expand Down

0 comments on commit c0c0c1f

Please sign in to comment.