File tree Expand file tree Collapse file tree 5 files changed +15
-6
lines changed Expand file tree Collapse file tree 5 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ async def test_delete_human(self) -> None:
120
120
self .assertNotIsInstance (e , TimeoutError )
121
121
pass
122
122
123
- async def test_run_human (self ):
123
+ async def test_run_human (self ) -> None :
124
124
name = utils .random_name ()
125
125
126
126
async with AsyncExitStack () as stack :
Original file line number Diff line number Diff line change 1
1
# This file was automatically generated. DO NOT EDIT.
2
2
# If you have any remark or suggestion do not hesitate to open an issue.
3
+ import importlib
4
+ from typing import TYPE_CHECKING
3
5
from .types import Arch
4
6
from .types import BootType
5
7
from .types import ImageState
113
115
from .content import TASK_TRANSIENT_STATUSES
114
116
from .content import VOLUME_SERVER_TRANSIENT_STATUSES
115
117
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
117
125
118
126
__all__ = [
119
127
"Arch" ,
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ def test_delete_human(self) -> None:
120
120
self .assertNotIsInstance (e , TimeoutError )
121
121
pass
122
122
123
- def test_run_human (self ):
123
+ def test_run_human (self ) -> None :
124
124
name = utils .random_name ()
125
125
126
126
with ExitStack () as stack :
Original file line number Diff line number Diff line change @@ -110,19 +110,20 @@ def test_unmarshal_Human(self) -> None:
110
110
self ._assert_raw_and_unmarshalled_human (data , human )
111
111
112
112
def test_unmarshal_ListHumansResponse (self ) -> None :
113
+ humans = [_mock_human_raw () for _ in range (10 )]
113
114
data = {
114
- "humans" : [ _mock_human_raw () for _ in range ( 10 )] ,
115
+ "humans" : humans ,
115
116
"total_count" : 1 ,
116
117
}
117
118
118
119
list_humans_response = unmarshal_ListHumansResponse (data )
119
120
120
121
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 ))
122
123
123
124
for i in range (len (list_humans_response .humans )):
124
125
self ._assert_raw_and_unmarshalled_human (
125
- data [ " humans" ] [i ], list_humans_response .humans [i ]
126
+ humans [i ], list_humans_response .humans [i ]
126
127
)
127
128
128
129
You can’t perform that action at this time.
0 commit comments