Skip to content

Commit 9f87359

Browse files
committed
tests: fix typing issues
1 parent d9a09c2 commit 9f87359

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

scaleway-async/tests/test_test_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ async def test_delete_human(self) -> None:
120120
self.assertNotIsInstance(e, TimeoutError)
121121
pass
122122

123-
async def test_run_human(self):
123+
async def test_run_human(self) -> None:
124124
name = utils.random_name()
125125

126126
async with AsyncExitStack() as stack:

scaleway/scaleway/instance/v1/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# This file was automatically generated. DO NOT EDIT.
22
# If you have any remark or suggestion do not hesitate to open an issue.
3+
import importlib
4+
from typing import TYPE_CHECKING
35
from .types import Arch
46
from .types import BootType
57
from .types import ImageState
@@ -113,7 +115,13 @@
113115
from .content import TASK_TRANSIENT_STATUSES
114116
from .content import VOLUME_SERVER_TRANSIENT_STATUSES
115117
from .content import VOLUME_TRANSIENT_STATUSES
116-
from .api import InstanceV1API
118+
119+
try:
120+
from .api_utils import InstanceV1UtilsAPI as InstanceV1API # type: ignore
121+
except ImportError:
122+
from .api import InstanceV1API
123+
except ModuleNotFoundError:
124+
from .api import InstanceV1API
117125

118126
__all__ = [
119127
"Arch",

scaleway/scaleway/instance/v1/api_utils.py

Whitespace-only changes.

scaleway/tests/test_test_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def test_delete_human(self) -> None:
120120
self.assertNotIsInstance(e, TimeoutError)
121121
pass
122122

123-
def test_run_human(self):
123+
def test_run_human(self) -> None:
124124
name = utils.random_name()
125125

126126
with ExitStack() as stack:

scaleway/tests/test_test_v1_marshalling.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,20 @@ def test_unmarshal_Human(self) -> None:
110110
self._assert_raw_and_unmarshalled_human(data, human)
111111

112112
def test_unmarshal_ListHumansResponse(self) -> None:
113+
humans = [_mock_human_raw() for _ in range(10)]
113114
data = {
114-
"humans": [_mock_human_raw() for _ in range(10)],
115+
"humans": humans,
115116
"total_count": 1,
116117
}
117118

118119
list_humans_response = unmarshal_ListHumansResponse(data)
119120

120121
self.assertTrue(isinstance(list_humans_response, ListHumansResponse))
121-
self.assertEqual(len(list_humans_response.humans), len(data["humans"]))
122+
self.assertEqual(len(list_humans_response.humans), len(humans))
122123

123124
for i in range(len(list_humans_response.humans)):
124125
self._assert_raw_and_unmarshalled_human(
125-
data["humans"][i], list_humans_response.humans[i]
126+
humans[i], list_humans_response.humans[i]
126127
)
127128

128129

0 commit comments

Comments
 (0)