@@ -141,6 +141,31 @@ def get_smile_services_response() -> Dict[str, Any]:
141141 }
142142
143143
144+ def test_show_deprecation_when_use_validation_is_true (
145+ setup_client : Tuple [str , str , str ]
146+ ) -> None :
147+ api_key , partner_id , _ = setup_client
148+ id_info_params = {
149+ "first_name" : "" ,
150+ "last_name" : "" ,
151+ "country" : "" ,
152+ "id_type" : "" ,
153+ "id_number" : "" ,
154+ "dob" : "" ,
155+ "entered" : None ,
156+ }
157+ partner_params = {
158+ "job_id" : f"job-{ uuid .uuid4 ()} " ,
159+ "user_id" : f"user-{ uuid .uuid4 ()} " ,
160+ "job_type" : JobType .BUSINESS_VERIFICATION ,
161+ }
162+ utilities = Utilities (partner_id , api_key , 0 )
163+ with pytest .deprecated_call ():
164+ utilities .validate_id_params (
165+ 0 , id_info_params , partner_params , use_validation_api = True
166+ )
167+
168+
144169def test_validate_id_params (
145170 setup_client : Tuple [str , str , str ], signature_fixture : Signature
146171) -> None :
@@ -305,7 +330,6 @@ def test_validate_id_params_should_raise_when_provided_with_invalid_input(
305330 """Validate id parameters using the smile services endpoint which
306331 checks the provided id params, and partner params"""
307332
308- stub_service ("https://testapi.smileidentity.com/v1" )
309333 kyc_id_info ["country" ] = ""
310334 with pytest .raises (ValueError ) as value_error :
311335 Utilities .validate_id_params (
@@ -332,59 +356,6 @@ def test_validate_id_params_should_raise_when_provided_with_invalid_input(
332356 kyc_partner_params ,
333357 )
334358 assert str (value_error .value ) == "key id_number cannot be empty"
335- kyc_id_info ["id_number" ] = "A00000000"
336- kyc_id_info ["country" ] = "ZW"
337- with pytest .raises (ValueError ) as value_error :
338- Utilities .validate_id_params (
339- client_utilities .url ,
340- kyc_id_info ,
341- kyc_partner_params ,
342- use_validation_api = True ,
343- )
344- assert str (value_error .value ) == "country ZW is invalid"
345-
346- kyc_id_info ["country" ] = "NG"
347- kyc_id_info ["id_type" ] = "Not_Supported"
348- with pytest .raises (ValueError ) as value_error :
349- Utilities .validate_id_params (
350- client_utilities .url ,
351- kyc_id_info ,
352- kyc_partner_params ,
353- use_validation_api = True ,
354- )
355- assert str (value_error .value ) == "id_type Not_Supported is invalid"
356- kyc_id_info ["id_type" ] = "PASSPORT"
357- kyc_partner_params ["user_id" ] = None
358- with pytest .raises (ValueError ) as value_error :
359- Utilities .validate_id_params (
360- client_utilities .url ,
361- kyc_id_info ,
362- kyc_partner_params ,
363- use_validation_api = True ,
364- )
365- assert str (value_error .value ) == "key user_id cannot be empty"
366-
367- kyc_partner_params ["user_id" ] = "kyb_test_user_008"
368- kyc_id_info ["first_name" ] = ""
369- with pytest .raises (ValueError ) as value_error :
370- Utilities .validate_id_params (
371- client_utilities .url ,
372- kyc_id_info ,
373- kyc_partner_params ,
374- use_validation_api = True ,
375- )
376- assert str (value_error .value ) == "key first_name cannot be empty"
377- kyc_id_info ["first_name" ] = "FirstName"
378- updated_partner_params = dict (kyc_partner_params )
379- del updated_partner_params ["user_id" ]
380- with pytest .raises (ValueError ) as value_error :
381- Utilities .validate_id_params (
382- client_utilities .url ,
383- kyc_id_info ,
384- updated_partner_params ,
385- use_validation_api = True ,
386- )
387- assert str (value_error .value ) == "key user_id is required"
388359
389360
390361@responses .activate
@@ -414,28 +385,6 @@ def test_validate_id_params_raise_when_given_invalid_input_for_jt6(
414385 )
415386 assert str (value_error .value ) == "key id_type cannot be empty"
416387
417- kyc_id_info ["id_type" ] = "PASSPORT"
418- kyc_id_info ["country" ] = "ZW"
419- with pytest .raises (ValueError ) as value_error :
420- Utilities .validate_id_params (
421- client_utilities .url ,
422- kyc_id_info ,
423- partner_params_jt6 ,
424- use_validation_api = True ,
425- )
426- assert str (value_error .value ) == "country ZW is invalid"
427-
428- kyc_id_info ["country" ] = "NG"
429- kyc_id_info ["id_type" ] = "Not_Supported"
430- with pytest .raises (ValueError ) as value_error :
431- Utilities .validate_id_params (
432- client_utilities .url ,
433- kyc_id_info ,
434- partner_params_jt6 ,
435- use_validation_api = True ,
436- )
437- assert str (value_error .value ) == "id_type Not_Supported is invalid"
438-
439388
440389@responses .activate
441390def test_get_job_status (
0 commit comments