Skip to content

Commit

Permalink
⚡ optimize & sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
MEHRSHAD-MIRSHEKARY committed Oct 4, 2024
1 parent 7d89bee commit ec0b0b0
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 26 deletions.
2 changes: 1 addition & 1 deletion response_shaper/decorators.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from functools import wraps
from typing import Callable, Any
from typing import Any, Callable

from rest_framework.response import Response

Expand Down
2 changes: 1 addition & 1 deletion response_shaper/tests/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.conf import settings
import django
from django.conf import settings


def configure_django_settings() -> None:
Expand Down
24 changes: 13 additions & 11 deletions response_shaper/tests/test_api_responses.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import pytest
import sys
from rest_framework.test import APIClient

import pytest
from rest_framework import status
from response_shaper.tests.constants import PYTHON_VERSION, PYTHON_VERSION_REASON
from rest_framework.test import APIClient

from response_shaper.responses import (
api_response,
paginated_api_response,
auth_api_response,
batch_api_response,
error_api_response,
minimal_success_response,
hateoas_api_response,
metadata_api_response,
batch_api_response,
auth_api_response,
minimal_success_response,
multi_resource_response,
paginated_api_response,
rate_limited_response,
upload_progress_response,
service_availability_response,
redirect_response,
hateoas_api_response,
multi_resource_response,
service_availability_response,
upload_progress_response,
)
from response_shaper.tests.constants import PYTHON_VERSION, PYTHON_VERSION_REASON

pytestmark = [
pytest.mark.api_responses,
Expand Down
14 changes: 8 additions & 6 deletions response_shaper/tests/test_decorators.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import sys
from typing import Callable, Dict

import pytest
from rest_framework.response import Response
from rest_framework import status
from response_shaper.tests.constants import PYTHON_VERSION, PYTHON_VERSION_REASON
from typing import Dict, Callable
from rest_framework.response import Response

from response_shaper.decorators import (
format_api_response,
format_paginated_response,
format_auth_response,
format_batch_response,
format_error_response,
format_minimal_success_response,
format_batch_response,
format_auth_response,
format_paginated_response,
response_decorator,
)
from response_shaper.responses import api_response
from response_shaper.tests.constants import PYTHON_VERSION, PYTHON_VERSION_REASON

pytestmark = [
pytest.mark.decorators,
Expand Down
10 changes: 6 additions & 4 deletions response_shaper/tests/test_middleware.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import pytest
import json
import sys
from unittest.mock import patch, MagicMock
from django.http import JsonResponse, HttpResponse, HttpRequest
from typing import Callable, Dict, List
from unittest.mock import MagicMock, patch

import pytest
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import IntegrityError
from django.http import HttpRequest, HttpResponse, JsonResponse
from django.test import RequestFactory

from response_shaper.middleware import DynamicResponseMiddleware
from response_shaper.settings.conf import response_shaper_config
from response_shaper.tests.constants import PYTHON_VERSION, PYTHON_VERSION_REASON
from typing import Dict, Callable, List

pytestmark = [
pytest.mark.middleware,
Expand Down
8 changes: 5 additions & 3 deletions response_shaper/tests/test_settings.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import pytest
import sys
from django.core.checks import Error
from unittest.mock import MagicMock, patch

import pytest
from django.conf import settings
from unittest.mock import patch, MagicMock
from django.core.checks import Error

from response_shaper.settings.check import check_response_shaper_settings
from response_shaper.tests.constants import PYTHON_VERSION, PYTHON_VERSION_REASON

Expand Down

0 comments on commit ec0b0b0

Please sign in to comment.