File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 44test all Direct API methods against the live Nutrient DWS API.
55"""
66
7- from typing import Optional , Union
8-
97import pytest
108
119from nutrient_dws import NutrientClient
1210
1311try :
1412 from . import integration_config # type: ignore[attr-defined]
1513
16- API_KEY : Optional [ str ] = integration_config .API_KEY
17- BASE_URL : Optional [ str ] = getattr (integration_config , "BASE_URL" , None )
14+ API_KEY : str | None = integration_config .API_KEY
15+ BASE_URL : str | None = getattr (integration_config , "BASE_URL" , None )
1816 TIMEOUT : int = getattr (integration_config , "TIMEOUT" , 60 )
1917except ImportError :
2018 API_KEY = None
2119 BASE_URL = None
2220 TIMEOUT = 60
2321
2422
25- def assert_is_pdf (file_path_or_bytes : Union [ str , bytes ] ) -> None :
23+ def assert_is_pdf (file_path_or_bytes : str | bytes ) -> None :
2624 """Assert that a file or bytes is a valid PDF.
2725
2826 Args:
2927 file_path_or_bytes: Path to file or bytes content to check.
3028 """
31- if isinstance (file_path_or_bytes , ( str , bytes ) ):
29+ if isinstance (file_path_or_bytes , str | bytes ):
3230 if isinstance (file_path_or_bytes , str ):
3331 with open (file_path_or_bytes , "rb" ) as f :
3432 content = f .read (8 )
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def assert_is_pdf(file_path_or_bytes: str | bytes) -> None:
2727 Args:
2828 file_path_or_bytes: Path to file or bytes content to check.
2929 """
30- if isinstance (file_path_or_bytes , ( str , bytes ) ):
30+ if isinstance (file_path_or_bytes , str | bytes ):
3131 if isinstance (file_path_or_bytes , str ):
3232 with open (file_path_or_bytes , "rb" ) as f :
3333 content = f .read (8 )
Original file line number Diff line number Diff line change 11"""Basic smoke test to validate integration test setup."""
22
3- from typing import Optional
4-
53import pytest
64
75from nutrient_dws import NutrientClient
86
97# Type annotation for mypy
10- API_KEY : Optional [ str ] = None
8+ API_KEY : str | None = None
119
1210try :
1311 from . import integration_config # type: ignore[attr-defined]
You can’t perform that action at this time.
0 commit comments