@@ -93,38 +93,14 @@ async def test_get_ephemeral_TypeError(credentials: Credentials) -> None:
9393 when given incorrect input arg types.
9494 """
9595 client_session = Mock (aiohttp .ClientSession )
96- project = "my-project"
97- instance = "my-instance"
98- pub_key = "key"
99-
100- # incorrect project type
101- with pytest .raises (TypeError ):
102- await _get_ephemeral (
103- client_session = client_session ,
104- sqladmin_api_endpoint = "https://sqladmin.googleapis.com" ,
105- credentials = credentials ,
106- project = 12345 ,
107- instance = instance ,
108- pub_key = pub_key ,
109- )
110- # incorrect instance type
111- with pytest .raises (TypeError ):
112- await _get_ephemeral (
113- client_session = client_session ,
114- sqladmin_api_endpoint = "https://sqladmin.googleapis.com" ,
115- credentials = credentials ,
116- project = project ,
117- instance = 12345 ,
118- pub_key = pub_key ,
119- )
12096 # incorrect pub_key type
12197 with pytest .raises (TypeError ):
12298 await _get_ephemeral (
12399 client_session = client_session ,
124100 sqladmin_api_endpoint = "https://sqladmin.googleapis.com" ,
125101 credentials = credentials ,
126- project = project ,
127- instance = instance ,
102+ project = "my- project" ,
103+ instance = "my- instance" ,
128104 pub_key = 12345 ,
129105 )
130106
@@ -166,50 +142,6 @@ async def test_get_metadata(
166142 )
167143
168144
169- @pytest .mark .asyncio
170- @no_type_check
171- async def test_get_metadata_TypeError (credentials : Credentials ) -> None :
172- """
173- Test to check whether _get_metadata throws proper TypeError
174- when given incorrect input arg types.
175- """
176- client_session = Mock (aiohttp .ClientSession )
177- project = "my-project"
178- region = "my-region"
179- instance = "my-instance"
180-
181- # incorrect project type
182- with pytest .raises (TypeError ):
183- await _get_metadata (
184- client_session = client_session ,
185- sqladmin_api_endpoint = "https://sqladmin.googleapis.com" ,
186- credentials = credentials ,
187- project = 12345 ,
188- region = region ,
189- instance = instance ,
190- )
191- # incorrect region type
192- with pytest .raises (TypeError ):
193- await _get_metadata (
194- client_session = client_session ,
195- sqladmin_api_endpoint = "https://sqladmin.googleapis.com" ,
196- credentials = credentials ,
197- project = project ,
198- region = 1 ,
199- instance = instance ,
200- )
201- # incorrect instance type
202- with pytest .raises (TypeError ):
203- await _get_metadata (
204- client_session = client_session ,
205- sqladmin_api_endpoint = "https://sqladmin.googleapis.com" ,
206- credentials = credentials ,
207- project = project ,
208- region = region ,
209- instance = 12345 ,
210- )
211-
212-
213145@pytest .mark .asyncio
214146@no_type_check
215147async def test_get_metadata_region_mismatch (
0 commit comments