@@ -37,7 +37,12 @@ def test_raises_on_missing_non_nullable_opts
3737 def test_client_default_request_default_retry_attempts
3838 stub_request ( :post , "http://localhost/api/v1/files/upload" ) . to_return_json ( status : 500 , body : { } )
3939
40- image_kit = Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" )
40+ image_kit =
41+ Imagekitio ::Client . new (
42+ base_url : "http://localhost" ,
43+ private_key : "My Private Key" ,
44+ password : "My Password"
45+ )
4146
4247 assert_raises ( Imagekitio ::Errors ::InternalServerError ) do
4348 image_kit . files . upload ( file : StringIO . new ( "Example data" ) , file_name : "fileName" )
@@ -50,7 +55,12 @@ def test_client_given_request_default_retry_attempts
5055 stub_request ( :post , "http://localhost/api/v1/files/upload" ) . to_return_json ( status : 500 , body : { } )
5156
5257 image_kit =
53- Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" , max_retries : 3 )
58+ Imagekitio ::Client . new (
59+ base_url : "http://localhost" ,
60+ private_key : "My Private Key" ,
61+ password : "My Password" ,
62+ max_retries : 3
63+ )
5464
5565 assert_raises ( Imagekitio ::Errors ::InternalServerError ) do
5666 image_kit . files . upload ( file : StringIO . new ( "Example data" ) , file_name : "fileName" )
@@ -62,7 +72,12 @@ def test_client_given_request_default_retry_attempts
6272 def test_client_default_request_given_retry_attempts
6373 stub_request ( :post , "http://localhost/api/v1/files/upload" ) . to_return_json ( status : 500 , body : { } )
6474
65- image_kit = Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" )
75+ image_kit =
76+ Imagekitio ::Client . new (
77+ base_url : "http://localhost" ,
78+ private_key : "My Private Key" ,
79+ password : "My Password"
80+ )
6681
6782 assert_raises ( Imagekitio ::Errors ::InternalServerError ) do
6883 image_kit . files . upload (
@@ -79,7 +94,12 @@ def test_client_given_request_given_retry_attempts
7994 stub_request ( :post , "http://localhost/api/v1/files/upload" ) . to_return_json ( status : 500 , body : { } )
8095
8196 image_kit =
82- Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" , max_retries : 3 )
97+ Imagekitio ::Client . new (
98+ base_url : "http://localhost" ,
99+ private_key : "My Private Key" ,
100+ password : "My Password" ,
101+ max_retries : 3
102+ )
83103
84104 assert_raises ( Imagekitio ::Errors ::InternalServerError ) do
85105 image_kit . files . upload (
@@ -100,7 +120,12 @@ def test_client_retry_after_seconds
100120 )
101121
102122 image_kit =
103- Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" , max_retries : 1 )
123+ Imagekitio ::Client . new (
124+ base_url : "http://localhost" ,
125+ private_key : "My Private Key" ,
126+ password : "My Password" ,
127+ max_retries : 1
128+ )
104129
105130 assert_raises ( Imagekitio ::Errors ::InternalServerError ) do
106131 image_kit . files . upload ( file : StringIO . new ( "Example data" ) , file_name : "fileName" )
@@ -120,7 +145,12 @@ def test_client_retry_after_date
120145 )
121146
122147 image_kit =
123- Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" , max_retries : 1 )
148+ Imagekitio ::Client . new (
149+ base_url : "http://localhost" ,
150+ private_key : "My Private Key" ,
151+ password : "My Password" ,
152+ max_retries : 1
153+ )
124154
125155 Thread . current . thread_variable_set ( :time_now , time_now )
126156 assert_raises ( Imagekitio ::Errors ::InternalServerError ) do
@@ -140,7 +170,12 @@ def test_client_retry_after_ms
140170 )
141171
142172 image_kit =
143- Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" , max_retries : 1 )
173+ Imagekitio ::Client . new (
174+ base_url : "http://localhost" ,
175+ private_key : "My Private Key" ,
176+ password : "My Password" ,
177+ max_retries : 1
178+ )
144179
145180 assert_raises ( Imagekitio ::Errors ::InternalServerError ) do
146181 image_kit . files . upload ( file : StringIO . new ( "Example data" ) , file_name : "fileName" )
@@ -153,7 +188,12 @@ def test_client_retry_after_ms
153188 def test_retry_count_header
154189 stub_request ( :post , "http://localhost/api/v1/files/upload" ) . to_return_json ( status : 500 , body : { } )
155190
156- image_kit = Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" )
191+ image_kit =
192+ Imagekitio ::Client . new (
193+ base_url : "http://localhost" ,
194+ private_key : "My Private Key" ,
195+ password : "My Password"
196+ )
157197
158198 assert_raises ( Imagekitio ::Errors ::InternalServerError ) do
159199 image_kit . files . upload ( file : StringIO . new ( "Example data" ) , file_name : "fileName" )
@@ -167,7 +207,12 @@ def test_retry_count_header
167207 def test_omit_retry_count_header
168208 stub_request ( :post , "http://localhost/api/v1/files/upload" ) . to_return_json ( status : 500 , body : { } )
169209
170- image_kit = Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" )
210+ image_kit =
211+ Imagekitio ::Client . new (
212+ base_url : "http://localhost" ,
213+ private_key : "My Private Key" ,
214+ password : "My Password"
215+ )
171216
172217 assert_raises ( Imagekitio ::Errors ::InternalServerError ) do
173218 image_kit . files . upload (
@@ -185,7 +230,12 @@ def test_omit_retry_count_header
185230 def test_overwrite_retry_count_header
186231 stub_request ( :post , "http://localhost/api/v1/files/upload" ) . to_return_json ( status : 500 , body : { } )
187232
188- image_kit = Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" )
233+ image_kit =
234+ Imagekitio ::Client . new (
235+ base_url : "http://localhost" ,
236+ private_key : "My Private Key" ,
237+ password : "My Password"
238+ )
189239
190240 assert_raises ( Imagekitio ::Errors ::InternalServerError ) do
191241 image_kit . files . upload (
@@ -209,7 +259,12 @@ def test_client_redirect_307
209259 headers : { "location" => "/redirected" }
210260 )
211261
212- image_kit = Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" )
262+ image_kit =
263+ Imagekitio ::Client . new (
264+ base_url : "http://localhost" ,
265+ private_key : "My Private Key" ,
266+ password : "My Password"
267+ )
213268
214269 assert_raises ( Imagekitio ::Errors ::APIConnectionError ) do
215270 image_kit . files . upload (
@@ -242,7 +297,12 @@ def test_client_redirect_303
242297 headers : { "location" => "/redirected" }
243298 )
244299
245- image_kit = Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" )
300+ image_kit =
301+ Imagekitio ::Client . new (
302+ base_url : "http://localhost" ,
303+ private_key : "My Private Key" ,
304+ password : "My Password"
305+ )
246306
247307 assert_raises ( Imagekitio ::Errors ::APIConnectionError ) do
248308 image_kit . files . upload (
@@ -270,7 +330,12 @@ def test_client_redirect_auth_keep_same_origin
270330 headers : { "location" => "/redirected" }
271331 )
272332
273- image_kit = Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" )
333+ image_kit =
334+ Imagekitio ::Client . new (
335+ base_url : "http://localhost" ,
336+ private_key : "My Private Key" ,
337+ password : "My Password"
338+ )
274339
275340 assert_raises ( Imagekitio ::Errors ::APIConnectionError ) do
276341 image_kit . files . upload (
@@ -301,7 +366,12 @@ def test_client_redirect_auth_strip_cross_origin
301366 headers : { "location" => "https://example.com/redirected" }
302367 )
303368
304- image_kit = Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" )
369+ image_kit =
370+ Imagekitio ::Client . new (
371+ base_url : "http://localhost" ,
372+ private_key : "My Private Key" ,
373+ password : "My Password"
374+ )
305375
306376 assert_raises ( Imagekitio ::Errors ::APIConnectionError ) do
307377 image_kit . files . upload (
@@ -320,7 +390,12 @@ def test_client_redirect_auth_strip_cross_origin
320390 def test_default_headers
321391 stub_request ( :post , "http://localhost/api/v1/files/upload" ) . to_return_json ( status : 200 , body : { } )
322392
323- image_kit = Imagekitio ::Client . new ( base_url : "http://localhost" , private_key : "My Private Key" )
393+ image_kit =
394+ Imagekitio ::Client . new (
395+ base_url : "http://localhost" ,
396+ private_key : "My Private Key" ,
397+ password : "My Password"
398+ )
324399
325400 image_kit . files . upload ( file : StringIO . new ( "Example data" ) , file_name : "fileName" )
326401
0 commit comments