|
9 | 9 | class TestApproleRoutes(TestCase):
|
10 | 10 | """Unit tests providing coverage for approle auth backend-related methods/routes."""
|
11 | 11 |
|
| 12 | + |
| 13 | + |
12 | 14 | @parameterized.expand([
|
13 | 15 | ("default mount point", None, "application1"),
|
14 | 16 | ("custom mount point", "my-approle-path", "application2"),
|
@@ -40,6 +42,7 @@ async def test_create_role(self, test_label, mount_point, role_name, requests_mo
|
40 | 42 | first=expected_status_code,
|
41 | 43 | second=actual_response.status,
|
42 | 44 | )
|
| 45 | + await client.close() |
43 | 46 |
|
44 | 47 | @parameterized.expand([
|
45 | 48 | ("default mount point", None, "application1"),
|
@@ -81,6 +84,7 @@ async def test_list_roles(self, test_label, mount_point, role_name, requests_moc
|
81 | 84 |
|
82 | 85 | # ensure we received our mock response data back successfully
|
83 | 86 | self.assertEqual(mock_response, actual_response)
|
| 87 | + await client.close() |
84 | 88 |
|
85 | 89 | @parameterized.expand([
|
86 | 90 | ("default mount point", None, "application1", "40b3c82d-12a6-838c-9e74-1f1133867e06"),
|
@@ -127,6 +131,7 @@ async def test_get_role_id(self, test_label, mount_point, role_name, role_id, re
|
127 | 131 | first=role_id,
|
128 | 132 | second=actual_response
|
129 | 133 | )
|
| 134 | + await client.close() |
130 | 135 |
|
131 | 136 | @parameterized.expand([
|
132 | 137 | ("default mount point", None, "application1", "custom-role-id-1"),
|
@@ -157,10 +162,11 @@ async def test_set_role_id(self, test_label, mount_point, role_name, role_id, re
|
157 | 162 | mount_point=mount_point,
|
158 | 163 | )
|
159 | 164 |
|
160 |
| - self.assertEquals( |
| 165 | + self.assertEqual( |
161 | 166 | first=expected_status_code,
|
162 | 167 | second=actual_response.status,
|
163 | 168 | )
|
| 169 | + await client.close() |
164 | 170 |
|
165 | 171 | @parameterized.expand([
|
166 | 172 | ("default mount point", None, "application1"),
|
@@ -212,10 +218,11 @@ async def test_get_role(self, test_label, mount_point, role_name, requests_mocke
|
212 | 218 | mount_point=mount_point,
|
213 | 219 | )
|
214 | 220 |
|
215 |
| - self.assertEquals( |
| 221 | + self.assertEqual( |
216 | 222 | first=mock_response,
|
217 | 223 | second=actual_response,
|
218 | 224 | )
|
| 225 | + await client.close() |
219 | 226 |
|
220 | 227 | @parameterized.expand([
|
221 | 228 | ("default mount point", None, "application1"),
|
@@ -259,10 +266,11 @@ async def test_create_role_secret_id(self, test_label, mount_point, role_name, r
|
259 | 266 | mount_point=mount_point,
|
260 | 267 | )
|
261 | 268 |
|
262 |
| - self.assertEquals( |
| 269 | + self.assertEqual( |
263 | 270 | first=mock_response,
|
264 | 271 | second=actual_response,
|
265 | 272 | )
|
| 273 | + await client.close() |
266 | 274 |
|
267 | 275 | @parameterized.expand([
|
268 | 276 | ("default mount point", None, "application1", "be78e3ca-f644-b099-3291-e8a6f5985cfe"),
|
@@ -314,10 +322,11 @@ async def test_get_role_secret_id(self, test_label, mount_point, role_name, secr
|
314 | 322 | mount_point=mount_point,
|
315 | 323 | )
|
316 | 324 |
|
317 |
| - self.assertEquals( |
| 325 | + self.assertEqual( |
318 | 326 | first=mock_response,
|
319 | 327 | second=actual_response,
|
320 | 328 | )
|
| 329 | + await client.close() |
321 | 330 |
|
322 | 331 | @parameterized.expand([
|
323 | 332 | ("default mount point", None, "application1", "be78e3ca-f644-b099-3291-e8a6f5985cfe"),
|
@@ -362,10 +371,11 @@ async def test_list_role_secrets(self, test_label, mount_point, role_name, secre
|
362 | 371 | mount_point=mount_point,
|
363 | 372 | )
|
364 | 373 |
|
365 |
| - self.assertEquals( |
| 374 | + self.assertEqual( |
366 | 375 | first=mock_response,
|
367 | 376 | second=actual_response,
|
368 | 377 | )
|
| 378 | + await client.close() |
369 | 379 |
|
370 | 380 | @parameterized.expand([
|
371 | 381 | ("default mount point", None, "application1", "be78e3ca-f644-b099-3291-e8a6f5985cfe"),
|
@@ -417,10 +427,11 @@ async def test_get_role_secret_id_accessor(self, test_label, mount_point, role_n
|
417 | 427 | mount_point=mount_point,
|
418 | 428 | )
|
419 | 429 |
|
420 |
| - self.assertEquals( |
| 430 | + self.assertEqual( |
421 | 431 | first=mock_response,
|
422 | 432 | second=actual_response,
|
423 | 433 | )
|
| 434 | + await client.close() |
424 | 435 |
|
425 | 436 | @parameterized.expand([
|
426 | 437 | ("default mount point", None, "application1", "be78e3ca-f644-b099-3291-e8a6f5985cfe"),
|
@@ -452,10 +463,11 @@ async def test_delete_role_secret_id(self, test_label, mount_point, role_name, s
|
452 | 463 | mount_point=mount_point,
|
453 | 464 | )
|
454 | 465 |
|
455 |
| - self.assertEquals( |
| 466 | + self.assertEqual( |
456 | 467 | first=expected_status_code,
|
457 | 468 | second=actual_response.status,
|
458 | 469 | )
|
| 470 | + await client.close() |
459 | 471 |
|
460 | 472 | @parameterized.expand([
|
461 | 473 | ("default mount point", None, "application1", "be78e3ca-f644-b099-3291-e8a6f5985cfe"),
|
@@ -488,10 +500,11 @@ async def test_delete_role_secret_id_accessor(self, test_label, mount_point, rol
|
488 | 500 | mount_point=mount_point,
|
489 | 501 | )
|
490 | 502 |
|
491 |
| - self.assertEquals( |
| 503 | + self.assertEqual( |
492 | 504 | first=expected_status_code,
|
493 | 505 | second=actual_response.status,
|
494 | 506 | )
|
| 507 | + await client.close() |
495 | 508 |
|
496 | 509 | @parameterized.expand([
|
497 | 510 | ("default mount point", None, "application1", "be78e3ca-f644-b099-3291-e8a6f5985cfe"),
|
@@ -536,10 +549,11 @@ async def test_create_role_custom_secret_id(self, test_label, mount_point, role_
|
536 | 549 | mount_point=mount_point,
|
537 | 550 | )
|
538 | 551 |
|
539 |
| - self.assertEquals( |
| 552 | + self.assertEqual( |
540 | 553 | first=mock_response,
|
541 | 554 | second=actual_response,
|
542 | 555 | )
|
| 556 | + await client.close() |
543 | 557 |
|
544 | 558 | @parameterized.expand([
|
545 | 559 | ("default mount point", None, "c7f93182-c6b1-4b6a-9dfb-03bdb6df0026", "26089502-b7d3-412a-b3e6-3d44300f9bd1"),
|
@@ -595,3 +609,4 @@ async def test_auth_approle(self, test_label, mount_point, role_id, secret_id, r
|
595 | 609 | first=mock_response,
|
596 | 610 | second=actual_response,
|
597 | 611 | )
|
| 612 | + await client.close() |
0 commit comments