Skip to content

Commit 20b02ae

Browse files
committed
refactor: update type hints from 'list' to 'List'
1 parent c23a1ec commit 20b02ae

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/authkit_token/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""API functions for interacting with Pica AuthKit."""
22

33
import asyncio
4-
from typing import Dict, Optional
4+
from typing import Dict, List, Optional
55

66
import httpx
77

@@ -77,7 +77,7 @@ async def fetch_page_with_retry(client: httpx.AsyncClient, page: int) -> Authkit
7777
remaining_pages = list(range(2, pages + 1))
7878

7979
# Execute requests in batches to avoid overwhelming the API
80-
responses: list[AuthkitResponse] = [first_response]
80+
responses: List[AuthkitResponse] = [first_response]
8181

8282
for i in range(0, len(remaining_pages), max_concurrent_requests):
8383
batch = remaining_pages[i : i + max_concurrent_requests]
@@ -175,7 +175,7 @@ def fetch_page_with_retry(client: httpx.Client, page: int) -> AuthkitResponse:
175175
remaining_pages = list(range(2, pages + 1))
176176

177177
# Fetch remaining pages sequentially (no concurrent requests in sync mode)
178-
responses: list[AuthkitResponse] = [first_response]
178+
responses: List[AuthkitResponse] = [first_response]
179179

180180
for page in remaining_pages:
181181
try:

tests/test_client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Tests for the AuthKitToken client."""
22

3+
from typing import Dict, List
4+
35
import pytest
46
from pytest_httpx import HTTPXMock
57

@@ -37,7 +39,7 @@ def mock_authkit_response() -> dict:
3739

3840

3941
@pytest.fixture
40-
def mock_authkit_paginated_response() -> list[dict]:
42+
def mock_authkit_paginated_response() -> List[Dict]:
4143
"""Mock paginated response from authkit API."""
4244
return [
4345
{
@@ -157,7 +159,7 @@ def test_create_sync_with_identity(
157159
assert request.headers["Content-Type"] == "application/json"
158160

159161
def test_create_sync_pagination(
160-
self, httpx_mock: HTTPXMock, mock_authkit_paginated_response: list[dict]
162+
self, httpx_mock: HTTPXMock, mock_authkit_paginated_response: List[Dict]
161163
) -> None:
162164
"""Test synchronous token creation with pagination."""
163165
# Mock all three pages
@@ -217,7 +219,7 @@ async def test_create_async_with_identity(
217219

218220
@pytest.mark.asyncio
219221
async def test_create_async_pagination(
220-
self, httpx_mock: HTTPXMock, mock_authkit_paginated_response: list[dict]
222+
self, httpx_mock: HTTPXMock, mock_authkit_paginated_response: List[Dict]
221223
) -> None:
222224
"""Test asynchronous token creation with pagination."""
223225
# Mock all three pages

0 commit comments

Comments
 (0)