@@ -240,8 +240,9 @@ def test_list_clusters_returns_empty_by_default(self) -> None:
240
240
assert isinstance (result , list )
241
241
assert len (result ) == 0
242
242
243
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
243
244
def test_list_clusters_returns_sorted_cluster_names (
244
- self , cluster_builder , initial_batch_size : int = BatchCountSize . SMALL
245
+ self , cluster_builder , initial_batch_size : int
245
246
) -> None :
246
247
eks_hook , generated_test_data = cluster_builder (count = initial_batch_size )
247
248
expected_result : list = sorted (generated_test_data .cluster_names )
@@ -250,18 +251,18 @@ def test_list_clusters_returns_sorted_cluster_names(
250
251
251
252
assert_result_matches_expected_list (result , expected_result , initial_batch_size )
252
253
253
- def test_list_clusters_returns_all_results (
254
- self , cluster_builder , initial_batch_size : int = BatchCountSize .LARGE
255
- ) -> None :
254
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .LARGE ])
255
+ def test_list_clusters_returns_all_results (self , cluster_builder , initial_batch_size : int ) -> None :
256
256
eks_hook , generated_test_data = cluster_builder (count = initial_batch_size )
257
257
expected_result : list = sorted (generated_test_data .cluster_names )
258
258
259
259
result : list = eks_hook .list_clusters ()
260
260
261
261
assert_result_matches_expected_list (result , expected_result )
262
262
263
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
263
264
def test_create_cluster_throws_exception_when_cluster_exists (
264
- self , cluster_builder , initial_batch_size : int = BatchCountSize . SMALL
265
+ self , cluster_builder , initial_batch_size : int
265
266
) -> None :
266
267
eks_hook , generated_test_data = cluster_builder (count = initial_batch_size )
267
268
expected_exception : type [AWSError ] = ResourceInUseException
@@ -329,8 +330,9 @@ def test_create_cluster_saves_provided_parameters(self, cluster_builder) -> None
329
330
for key , expected_value in generated_test_data .attributes_to_test :
330
331
assert generated_test_data .cluster_describe_output [key ] == expected_value
331
332
333
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
332
334
def test_describe_cluster_throws_exception_when_cluster_not_found (
333
- self , cluster_builder , initial_batch_size : int = BatchCountSize . SMALL
335
+ self , cluster_builder , initial_batch_size : int
334
336
) -> None :
335
337
eks_hook , generated_test_data = cluster_builder (count = initial_batch_size )
336
338
expected_exception : type [AWSError ] = ResourceNotFoundException
@@ -347,9 +349,8 @@ def test_describe_cluster_throws_exception_when_cluster_not_found(
347
349
raised_exception = raised_exception ,
348
350
)
349
351
350
- def test_delete_cluster_returns_deleted_cluster (
351
- self , cluster_builder , initial_batch_size : int = BatchCountSize .SMALL
352
- ) -> None :
352
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
353
+ def test_delete_cluster_returns_deleted_cluster (self , cluster_builder , initial_batch_size : int ) -> None :
353
354
eks_hook , generated_test_data = cluster_builder (count = initial_batch_size , minimal = False )
354
355
355
356
result : dict = eks_hook .delete_cluster (name = generated_test_data .existing_cluster_name )[
@@ -359,9 +360,8 @@ def test_delete_cluster_returns_deleted_cluster(
359
360
for key , expected_value in generated_test_data .attributes_to_test :
360
361
assert result [key ] == expected_value
361
362
362
- def test_delete_cluster_removes_deleted_cluster (
363
- self , cluster_builder , initial_batch_size : int = BatchCountSize .SMALL
364
- ) -> None :
363
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
364
+ def test_delete_cluster_removes_deleted_cluster (self , cluster_builder , initial_batch_size : int ) -> None :
365
365
eks_hook , generated_test_data = cluster_builder (count = initial_batch_size , minimal = False )
366
366
367
367
eks_hook .delete_cluster (name = generated_test_data .existing_cluster_name )
@@ -370,8 +370,9 @@ def test_delete_cluster_removes_deleted_cluster(
370
370
assert len (result_cluster_list ) == (initial_batch_size - 1 )
371
371
assert generated_test_data .existing_cluster_name not in result_cluster_list
372
372
373
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
373
374
def test_delete_cluster_throws_exception_when_cluster_not_found (
374
- self , cluster_builder , initial_batch_size : int = BatchCountSize . SMALL
375
+ self , cluster_builder , initial_batch_size : int
375
376
) -> None :
376
377
eks_hook , generated_test_data = cluster_builder (count = initial_batch_size )
377
378
expected_exception : type [AWSError ] = ResourceNotFoundException
@@ -399,8 +400,9 @@ def test_list_nodegroups_returns_empty_by_default(self, cluster_builder) -> None
399
400
assert isinstance (result , list )
400
401
assert len (result ) == 0
401
402
403
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
402
404
def test_list_nodegroups_returns_sorted_nodegroup_names (
403
- self , nodegroup_builder , initial_batch_size : int = BatchCountSize . SMALL
405
+ self , nodegroup_builder , initial_batch_size : int
404
406
) -> None :
405
407
eks_hook , generated_test_data = nodegroup_builder (count = initial_batch_size )
406
408
expected_result : list = sorted (generated_test_data .nodegroup_names )
@@ -409,9 +411,8 @@ def test_list_nodegroups_returns_sorted_nodegroup_names(
409
411
410
412
assert_result_matches_expected_list (result , expected_result , initial_batch_size )
411
413
412
- def test_list_nodegroups_returns_all_results (
413
- self , nodegroup_builder , initial_batch_size : int = BatchCountSize .LARGE
414
- ) -> None :
414
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .LARGE ])
415
+ def test_list_nodegroups_returns_all_results (self , nodegroup_builder , initial_batch_size : int ) -> None :
415
416
eks_hook , generated_test_data = nodegroup_builder (count = initial_batch_size )
416
417
expected_result : list = sorted (generated_test_data .nodegroup_names )
417
418
@@ -442,8 +443,9 @@ def test_create_nodegroup_throws_exception_when_cluster_not_found(self) -> None:
442
443
raised_exception = raised_exception ,
443
444
)
444
445
446
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
445
447
def test_create_nodegroup_throws_exception_when_nodegroup_already_exists (
446
- self , nodegroup_builder , initial_batch_size : int = BatchCountSize . SMALL
448
+ self , nodegroup_builder , initial_batch_size : int
447
449
) -> None :
448
450
eks_hook , generated_test_data = nodegroup_builder (count = initial_batch_size )
449
451
expected_exception : type [AWSError ] = ResourceInUseException
@@ -470,8 +472,9 @@ def test_create_nodegroup_throws_exception_when_nodegroup_already_exists(
470
472
)
471
473
assert nodegroup_count_after_test == initial_batch_size
472
474
475
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
473
476
def test_create_nodegroup_throws_exception_when_cluster_not_active (
474
- self , nodegroup_builder , initial_batch_size : int = BatchCountSize . SMALL
477
+ self , nodegroup_builder , initial_batch_size : int
475
478
) -> None :
476
479
eks_hook , generated_test_data = nodegroup_builder (count = initial_batch_size )
477
480
non_existent_nodegroup_name : str = NON_EXISTING_NODEGROUP_NAME
@@ -637,8 +640,9 @@ def test_delete_cluster_throws_exception_when_nodegroups_exist(self, nodegroup_b
637
640
cluster_count_after_test : int = len (eks_hook .list_clusters ())
638
641
assert cluster_count_after_test == BatchCountSize .SINGLE
639
642
643
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
640
644
def test_delete_nodegroup_removes_deleted_nodegroup (
641
- self , nodegroup_builder , initial_batch_size : int = BatchCountSize . SMALL
645
+ self , nodegroup_builder , initial_batch_size : int
642
646
) -> None :
643
647
eks_hook , generated_test_data = nodegroup_builder (count = initial_batch_size )
644
648
@@ -651,8 +655,9 @@ def test_delete_nodegroup_removes_deleted_nodegroup(
651
655
assert len (result_nodegroup_list ) == (initial_batch_size - 1 )
652
656
assert generated_test_data .existing_nodegroup_name not in result_nodegroup_list
653
657
658
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
654
659
def test_delete_nodegroup_returns_deleted_nodegroup (
655
- self , nodegroup_builder , initial_batch_size : int = BatchCountSize . SMALL
660
+ self , nodegroup_builder , initial_batch_size : int
656
661
) -> None :
657
662
eks_hook , generated_test_data = nodegroup_builder (count = initial_batch_size , minimal = False )
658
663
@@ -683,8 +688,9 @@ def test_delete_nodegroup_throws_exception_when_cluster_not_found(self, nodegrou
683
688
raised_exception = raised_exception ,
684
689
)
685
690
691
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
686
692
def test_delete_nodegroup_throws_exception_when_nodegroup_not_found (
687
- self , nodegroup_builder , initial_batch_size : int = BatchCountSize . SMALL
693
+ self , nodegroup_builder , initial_batch_size : int
688
694
) -> None :
689
695
eks_hook , generated_test_data = nodegroup_builder (count = initial_batch_size )
690
696
expected_exception : type [AWSError ] = ResourceNotFoundException
@@ -806,8 +812,9 @@ def test_list_fargate_profiles_returns_empty_by_default(self, cluster_builder) -
806
812
assert isinstance (result , list )
807
813
assert len (result ) == 0
808
814
815
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
809
816
def test_list_fargate_profiles_returns_sorted_profile_names (
810
- self , fargate_profile_builder , initial_batch_size : int = BatchCountSize . SMALL
817
+ self , fargate_profile_builder , initial_batch_size : int
811
818
) -> None :
812
819
eks_hook , generated_test_data = fargate_profile_builder (count = initial_batch_size )
813
820
expected_result : list = sorted (generated_test_data .fargate_profile_names )
@@ -816,8 +823,9 @@ def test_list_fargate_profiles_returns_sorted_profile_names(
816
823
817
824
assert_result_matches_expected_list (result , expected_result , initial_batch_size )
818
825
826
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .LARGE ])
819
827
def test_list_fargate_profiles_returns_all_results (
820
- self , fargate_profile_builder , initial_batch_size : int = BatchCountSize . LARGE
828
+ self , fargate_profile_builder , initial_batch_size : int
821
829
) -> None :
822
830
eks_hook , generated_test_data = fargate_profile_builder (count = initial_batch_size )
823
831
expected_result : list = sorted (generated_test_data .fargate_profile_names )
@@ -847,8 +855,9 @@ def test_create_fargate_profile_throws_exception_when_cluster_not_found(self) ->
847
855
raised_exception = raised_exception ,
848
856
)
849
857
858
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
850
859
def test_create_fargate_profile_throws_exception_when_fargate_profile_already_exists (
851
- self , fargate_profile_builder , initial_batch_size : int = BatchCountSize . SMALL
860
+ self , fargate_profile_builder , initial_batch_size : int
852
861
) -> None :
853
862
eks_hook , generated_test_data = fargate_profile_builder (count = initial_batch_size )
854
863
expected_exception : type [AWSError ] = ResourceInUseException
@@ -872,8 +881,9 @@ def test_create_fargate_profile_throws_exception_when_fargate_profile_already_ex
872
881
)
873
882
assert fargate_profile_count_after_test == initial_batch_size
874
883
884
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
875
885
def test_create_fargate_profile_throws_exception_when_cluster_not_active (
876
- self , fargate_profile_builder , initial_batch_size : int = BatchCountSize . SMALL
886
+ self , fargate_profile_builder , initial_batch_size : int
877
887
) -> None :
878
888
eks_hook , generated_test_data = fargate_profile_builder (count = initial_batch_size )
879
889
non_existent_fargate_profile_name : str = NON_EXISTING_FARGATE_PROFILE_NAME
@@ -976,8 +986,9 @@ def test_describe_fargate_profile_throws_exception_when_profile_not_found(
976
986
raised_exception = raised_exception ,
977
987
)
978
988
989
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
979
990
def test_delete_fargate_profile_removes_deleted_fargate_profile (
980
- self , fargate_profile_builder , initial_batch_size : int = BatchCountSize . SMALL
991
+ self , fargate_profile_builder , initial_batch_size : int
981
992
) -> None :
982
993
eks_hook , generated_test_data = fargate_profile_builder (initial_batch_size )
983
994
@@ -992,8 +1003,9 @@ def test_delete_fargate_profile_removes_deleted_fargate_profile(
992
1003
assert len (result_fargate_profile_list ) == (initial_batch_size - 1 )
993
1004
assert generated_test_data .existing_fargate_profile_name not in result_fargate_profile_list
994
1005
1006
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
995
1007
def test_delete_fargate_profile_returns_deleted_fargate_profile (
996
- self , fargate_profile_builder , initial_batch_size : int = BatchCountSize . SMALL
1008
+ self , fargate_profile_builder , initial_batch_size : int
997
1009
) -> None :
998
1010
eks_hook , generated_test_data = fargate_profile_builder (count = initial_batch_size , minimal = False )
999
1011
@@ -1026,8 +1038,9 @@ def test_delete_fargate_profile_throws_exception_when_cluster_not_found(
1026
1038
raised_exception = raised_exception ,
1027
1039
)
1028
1040
1041
+ @pytest .mark .parametrize ("initial_batch_size" , [BatchCountSize .SMALL ])
1029
1042
def test_delete_fargate_profile_throws_exception_when_fargate_profile_not_found (
1030
- self , fargate_profile_builder , initial_batch_size : int = BatchCountSize . SMALL
1043
+ self , fargate_profile_builder , initial_batch_size : int
1031
1044
) -> None :
1032
1045
eks_hook , generated_test_data = fargate_profile_builder (count = initial_batch_size )
1033
1046
expected_exception : type [AWSError ] = ResourceNotFoundException
@@ -1360,6 +1373,3 @@ def assert_is_valid_uri(value: str) -> None:
1360
1373
1361
1374
assert all ([result .scheme , result .netloc , result .path ])
1362
1375
assert REGION in value
1363
-
1364
-
1365
- # ruff: noqa: PT028
0 commit comments