@@ -838,3 +838,50 @@ def test_cloud_double_create_queue(self, is_fifo, tables_format):
838
838
time .sleep (1 )
839
839
queue_url2 = self ._sqs_api .create_queue (self .queue_name , is_fifo = is_fifo )
840
840
assert queue_url1 == queue_url2 , f'{ queue_url1 } vs { queue_url2 } '
841
+
842
+ @pytest .mark .parametrize (** TABLES_FORMAT_PARAMS )
843
+ @pytest .mark .parametrize (** IS_FIFO_PARAMS )
844
+ def test_not_throttling_with_custom_queue_name (self , is_fifo , tables_format ):
845
+ self ._init_with_params (is_fifo , tables_format )
846
+
847
+ self ._sqs_api = self ._create_api_for_user (
848
+ user_name = 'ignored' ,
849
+ raise_on_error = True ,
850
+ force_private = True ,
851
+ iam_token = self .iam_token ,
852
+ folder_id = self .folder_id ,
853
+ )
854
+
855
+ custom_queue_name = 'MyCustomQueue'
856
+ queue_url = self ._sqs_api .create_queue (
857
+ queue_name = self .queue_name ,
858
+ private_api = True ,
859
+ custom_name = custom_queue_name ,
860
+ )
861
+
862
+ nonexistent_queue_url = queue_url .replace (self .queue_name , self .queue_name + '_nonex' )
863
+
864
+ def get_attributes_of_nonexistent_queue ():
865
+ self ._sqs_api .get_queue_attributes (nonexistent_queue_url )
866
+
867
+ # Draining budget
868
+ for _ in range (16 ):
869
+ try :
870
+ get_attributes_of_nonexistent_queue ()
871
+ except Exception :
872
+ pass
873
+
874
+ # Check that there is no more budget
875
+ assert_that (
876
+ get_attributes_of_nonexistent_queue ,
877
+ raises (
878
+ RuntimeError ,
879
+ pattern = ".*<Code>ThrottlingException</Code>.*"
880
+ )
881
+ )
882
+
883
+ # Check that getting queue url with custom name still works
884
+ assert_that (
885
+ lambda : self ._sqs_api .get_queue_url (custom_queue_name ),
886
+ not_ (raises (RuntimeError ))
887
+ )
0 commit comments