From c8dae66e86a1edb44dd1e2d310d8a9bee249109e Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Mon, 26 Aug 2019 16:11:48 -0700 Subject: [PATCH 01/18] New Tests --- python/test.py | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 python/test.py diff --git a/python/test.py b/python/test.py new file mode 100644 index 000000000..9a94aaf69 --- /dev/null +++ b/python/test.py @@ -0,0 +1,67 @@ +import phonenumbers + +#Fixed by Phonenumbers Cases +valid_strings = ['+6323168971', + '+442083661177', + '+658003211137', + '+20573925008', + '+2057392500', + '+20225777444', + '+84384813220', + '+84357659677', + '+56232512653', # https://switchcomm.atlassian.net/browse/TEL-9285 + '+525547808256'] + +# National Format match +national_format_match = { '+525547808256' : '55 4780 8256'} + +# Number validity check +number_validity_check = { '1932621160' : 'BR' } + +# To be fixed by Dialpad Changes +dialpad_cases = ['+6278033212174', # https://switchcomm.atlassian.net/browse/DP-13742 + '+63283168971', # Philipines + '+8031000000141', # Dialpadistan + ] + +#Invalid Strings +invalid_strings = [ '+4916190899790', # https://switchcomm.atlassian.net/browse/TEL-8824 Not Fixed + '+2022577744', + '+205739250', + '+8412032453', # https://switchcomm.atlassian.net/browse/DP-13742 + ] + +print '######### -NUMBER VALIDITY CHECK - ###############' +for l in number_validity_check: + region = number_validity_check[l] + x = phonenumbers.parse(l, region) + print (x), 'Region : %s -> %10s' % (region, phonenumbers.is_valid_number(x)) + +print '######### -NUMBER FORMAT VALID - ################' +for l in national_format_match: + x = phonenumbers.parse(l, None) + y = phonenumbers.format_number(x, phonenumbers.PhoneNumberFormat.NATIONAL) + if national_format_match[l] == y: + status = 'Success' + else: + status = 'Failed' + + print (l), '-> %10s : %s' % (y, status) + +print '######### - VALID - ################' +for l in valid_strings: + x = phonenumbers.parse(l, None) + print (x), '%10s' % phonenumbers.is_valid_number(x) + +print '######### - DIALPAD - ################' +for l in dialpad_cases: + try: + x = phonenumbers.parse(l, None) + print (x), '%10s' % phonenumbers.is_valid_number(x) + except Exception as e: + print (l), '%10s' % (e) + +print '######### - INVALID - ################' +for l in invalid_strings: + x = phonenumbers.parse(l, None) + print (x), '%10s' % phonenumbers.is_valid_number(x) From 7e81015eb086b7d2e8d9aa5f484340e79b0daed1 Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Mon, 26 Aug 2019 16:12:33 -0700 Subject: [PATCH 02/18] New Tests --- python/test.py | 83 +++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/python/test.py b/python/test.py index 9a94aaf69..61819e10b 100644 --- a/python/test.py +++ b/python/test.py @@ -1,6 +1,6 @@ -import phonenumbers +import phonenumbers -#Fixed by Phonenumbers Cases +# Fixed by Phonenumbers Cases valid_strings = ['+6323168971', '+442083661177', '+658003211137', @@ -9,59 +9,58 @@ '+20225777444', '+84384813220', '+84357659677', - '+56232512653', # https://switchcomm.atlassian.net/browse/TEL-9285 + '+56232512653', # https://switchcomm.atlassian.net/browse/TEL-9285 '+525547808256'] -# National Format match -national_format_match = { '+525547808256' : '55 4780 8256'} +print '######### - VALID BY LIBRARY - ################' +for l in valid_strings: + x = phonenumbers.parse(l, None) + print (x), '%10s' % phonenumbers.is_valid_number(x) -# Number validity check -number_validity_check = { '1932621160' : 'BR' } # To be fixed by Dialpad Changes -dialpad_cases = ['+6278033212174', # https://switchcomm.atlassian.net/browse/DP-13742 - '+63283168971', # Philipines - '+8031000000141', # Dialpadistan +dialpad_cases = ['+6278033212174', # https://switchcomm.atlassian.net/browse/DP-13742 + '+63283168971', # Philipines + '+8031000000141', # Dialpadistan ] -#Invalid Strings -invalid_strings = [ '+4916190899790', # https://switchcomm.atlassian.net/browse/TEL-8824 Not Fixed - '+2022577744', - '+205739250', - '+8412032453', # https://switchcomm.atlassian.net/browse/DP-13742 - ] +print '######### - VALID BY DIALPAD - ################' +for l in dialpad_cases: + try: + x = phonenumbers.parse(l, None) + print (x), '%10s' % phonenumbers.is_valid_number(x) + except Exception as e: + print (l), '%10s' % (e) + +# Invalid Strings +invalid_strings = ['+4916190899790', # https://switchcomm.atlassian.net/browse/TEL-8824 Not Fixed + '+2022577744', + '+205739250', + '+8412032453', # https://switchcomm.atlassian.net/browse/DP-13742 + ] -print '######### -NUMBER VALIDITY CHECK - ###############' -for l in number_validity_check: - region = number_validity_check[l] - x = phonenumbers.parse(l, region) - print (x), 'Region : %s -> %10s' % (region, phonenumbers.is_valid_number(x)) +print '######### - INVALID NUMBERS - ################' +for l in invalid_strings: + x = phonenumbers.parse(l, None) + print (x), '%10s' % phonenumbers.is_valid_number(x) -print '######### -NUMBER FORMAT VALID - ################' +# National Format match +national_format_match = {'+525547808256': '55 4780 8256'} + +print '######### - NUMBER FORMAT VALIDITY - ################' for l in national_format_match: x = phonenumbers.parse(l, None) y = phonenumbers.format_number(x, phonenumbers.PhoneNumberFormat.NATIONAL) if national_format_match[l] == y: status = 'Success' else: - status = 'Failed' - - print (l), '-> %10s : %s' % (y, status) + status = 'Failed' + print (l), '-> %10s : %s' % (y, status) -print '######### - VALID - ################' -for l in valid_strings: - x = phonenumbers.parse(l, None) - print (x), '%10s' % phonenumbers.is_valid_number(x) - -print '######### - DIALPAD - ################' -for l in dialpad_cases: - try: - x = phonenumbers.parse(l, None) - print (x), '%10s' % phonenumbers.is_valid_number(x) - except Exception as e: - print (l), '%10s' % (e) - -print '######### - INVALID - ################' -for l in invalid_strings: - x = phonenumbers.parse(l, None) - print (x), '%10s' % phonenumbers.is_valid_number(x) +# Number validity check +number_validity_check = {'1932621160': 'BR'} +print '######### - REGION NUMBER VALIDITY - ###############' +for l in number_validity_check: + region = number_validity_check[l] + x = phonenumbers.parse(l, region) + print (x), 'Region : %s -> %10s' % (region, phonenumbers.is_valid_number(x)) From 0908a39047ddfd40e234774d3aeef615bd3948ff Mon Sep 17 00:00:00 2001 From: Corey Burke Date: Tue, 31 Jul 2018 09:09:04 -0700 Subject: [PATCH 03/18] Add Dialpadistan region --- python/phonenumbers/data/__init__.py | 5 +++++ python/phonenumbers/data/region_DP.py | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 python/phonenumbers/data/region_DP.py diff --git a/python/phonenumbers/data/__init__.py b/python/phonenumbers/data/__init__.py index 8bc8e15c9..6b56f60f6 100644 --- a/python/phonenumbers/data/__init__.py +++ b/python/phonenumbers/data/__init__.py @@ -17,6 +17,7 @@ _AVAILABLE_REGION_CODES = ['AC','AD','AE','AF','AG','AI','AL','AM','AO','AR','AS','AT','AU','AW','AX','AZ','BA','BB','BD','BE','BF','BG','BH','BI','BJ','BL','BM','BN','BO','BQ','BR','BS','BT','BW','BY','BZ','CA','CC','CD','CF','CG','CH','CI','CK','CL','CM','CN','CO','CR','CU','CV','CW','CX','CY','CZ','DE','DJ','DK','DM','DO','DZ','EC','EE','EG','EH','ER','ES','ET','FI','FJ','FK','FM','FO','FR','GA','GB','GD','GE','GF','GG','GH','GI','GL','GM','GN','GP','GQ','GR','GT','GU','GW','GY','HK','HN','HR','HT','HU','ID','IE','IL','IM','IN','IO','IQ','IR','IS','IT','JE','JM','JO','JP','KE','KG','KH','KI','KM','KN','KP','KR','KW','KY','KZ','LA','LB','LC','LI','LK','LR','LS','LT','LU','LV','LY','MA','MC','MD','ME','MF','MG','MH','MK','ML','MM','MN','MO','MP','MQ','MR','MS','MT','MU','MV','MW','MX','MY','MZ','NA','NC','NE','NF','NG','NI','NL','NO','NP','NR','NU','NZ','OM','PA','PE','PF','PG','PH','PK','PL','PM','PR','PS','PT','PW','PY','QA','RE','RO','RS','RU','RW','SA','SB','SC','SD','SE','SG','SH','SI','SJ','SK','SL','SM','SN','SO','SR','SS','ST','SV','SX','SY','SZ','TA','TC','TD','TG','TH','TJ','TK','TL','TM','TN','TO','TR','TT','TV','TW','TZ','UA','UG','US','UY','UZ','VA','VC','VE','VG','VI','VN','VU','WF','WS','XK','YE','YT','ZA','ZM','ZW'] _AVAILABLE_NONGEO_COUNTRY_CODES = [800, 808, 870, 878, 881, 882, 883, 888, 979] +_DIALPADISTAN_NONGEO_REGION_CODES = ['DP'] def _load_region(code): __import__("region_%s" % code, globals(), locals(), @@ -29,6 +30,9 @@ def _load_region(code): for _country_code in _AVAILABLE_NONGEO_COUNTRY_CODES: PhoneMetadata.register_nongeo_region_loader(_country_code, _load_region) +for region_code in _DIALPADISTAN_NONGEO_REGION_CODES: + PhoneMetadata.register_region_loader(region_code, _load_region) + from .alt_format_255 import PHONE_ALT_FORMAT_255 from .alt_format_27 import PHONE_ALT_FORMAT_27 from .alt_format_30 import PHONE_ALT_FORMAT_30 @@ -298,4 +302,5 @@ def _load_region(code): 995: ("GE",), 996: ("KG",), 998: ("UZ",), + 803: ("DP",), # Dialpadistan } diff --git a/python/phonenumbers/data/region_DP.py b/python/phonenumbers/data/region_DP.py new file mode 100644 index 000000000..832109f9a --- /dev/null +++ b/python/phonenumbers/data/region_DP.py @@ -0,0 +1,8 @@ +"""Auto-generated file, do not edit by hand. 800 metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_DP = PhoneMetadata(id='DP', country_code=803, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='\\d{10}', possible_length=(10,)), + voip=PhoneNumberDesc(national_number_pattern='\\d{10}', possible_length=(10,)), + number_format=[NumberFormat(pattern='(\\d{3})(\\d{7})', format='\\1\\2')], + leading_zero_possible=False) From a72e79f5bf5371fc97dbb5a4fe7d75ab27eb7a96 Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Tue, 11 Feb 2020 19:46:09 -0800 Subject: [PATCH 04/18] TEL-10934 - Unable To Dialpad Florida Number From Desktop & Mobile App --- python/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/test.py b/python/test.py index 61819e10b..a39855a5d 100644 --- a/python/test.py +++ b/python/test.py @@ -10,7 +10,8 @@ '+84384813220', '+84357659677', '+56232512653', # https://switchcomm.atlassian.net/browse/TEL-9285 - '+525547808256'] + '+525547808256', + '+16892226575'] print '######### - VALID BY LIBRARY - ################' for l in valid_strings: @@ -36,7 +37,6 @@ invalid_strings = ['+4916190899790', # https://switchcomm.atlassian.net/browse/TEL-8824 Not Fixed '+2022577744', '+205739250', - '+8412032453', # https://switchcomm.atlassian.net/browse/DP-13742 ] print '######### - INVALID NUMBERS - ################' From d432dca3f5f2989c75e51288706241da895a81c4 Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Wed, 1 Jul 2020 14:36:10 -0700 Subject: [PATCH 05/18] Changes for new NPA in Canada --- python/test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/test.py b/python/test.py index a39855a5d..7c1730532 100644 --- a/python/test.py +++ b/python/test.py @@ -11,6 +11,7 @@ '+84357659677', '+56232512653', # https://switchcomm.atlassian.net/browse/TEL-9285 '+525547808256', + '+13677395285', '+16892226575'] print '######### - VALID BY LIBRARY - ################' From e07626f86c3c6d1c34192df2fbfb5c819a05294f Mon Sep 17 00:00:00 2001 From: Dana Hoffmann Date: Thu, 20 Sep 2018 10:52:05 -0700 Subject: [PATCH 06/18] DP-13742: Fix to Indonesia toll free numbers --- python/phonenumbers/data/region_ID.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/phonenumbers/data/region_ID.py b/python/phonenumbers/data/region_ID.py index 7e4266393..63119def4 100644 --- a/python/phonenumbers/data/region_ID.py +++ b/python/phonenumbers/data/region_ID.py @@ -5,7 +5,7 @@ general_desc=PhoneNumberDesc(national_number_pattern='00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}', possible_length=(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17), possible_length_local_only=(5, 6)), fixed_line=PhoneNumberDesc(national_number_pattern='2[124]\\d{7,8}|619\\d{8}|2(?:1(?:14|500)|2\\d{3})\\d{3}|61\\d{5,8}|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|[25][1-8]|3[1-68]|4[1-3]|6[1-3568]|7[0-469]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|43|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[124-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:[25]\\d|3[1-69]|4[1-6])|7(?:02|[125][1-9]|[36]\\d|4[1-8]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}', example_number='218350123', possible_length=(7, 8, 9, 10, 11), possible_length_local_only=(5, 6)), mobile=PhoneNumberDesc(national_number_pattern='8[1-35-9]\\d{7,10}', example_number='812345678', possible_length=(9, 10, 11, 12)), - toll_free=PhoneNumberDesc(national_number_pattern='00(?:1803\\d{5,11}|7803\\d{7})|(?:177\\d|800)\\d{5,7}', example_number='8001234567', possible_length=(8, 9, 10, 11, 12, 13, 14, 15, 16, 17)), + toll_free=PhoneNumberDesc(national_number_pattern='00[17]803\\d{7}|(?:177\\d|800)\\d{5,7}|001803\\d{6}|7803\\d{7}', example_number='8001234567', possible_length=(8, 9, 10, 11, 12, 13)), premium_rate=PhoneNumberDesc(national_number_pattern='809\\d{7}', example_number='8091234567', possible_length=(10,)), shared_cost=PhoneNumberDesc(national_number_pattern='804\\d{7}', example_number='8041234567', possible_length=(10,)), uan=PhoneNumberDesc(national_number_pattern='(?:1500|8071\\d{3})\\d{3}', example_number='8071123456', possible_length=(7, 10)), From c67608f3041c886a7db29a21f54cd243521840cb Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Thu, 15 Oct 2020 00:10:57 -0700 Subject: [PATCH 07/18] TEL-12621 - Unable dial new Poland Police prefix +48 47 731 4848 Summary: TEL-12621 - Unable dial new Poland Police prefix +48 47 731 4848 Test Plan: added Reviewers: jerin Differential Revision: https://phabricator.fspot.us/D14990 --- python/test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/test.py b/python/test.py index 7c1730532..237a2f1d5 100644 --- a/python/test.py +++ b/python/test.py @@ -12,7 +12,8 @@ '+56232512653', # https://switchcomm.atlassian.net/browse/TEL-9285 '+525547808256', '+13677395285', - '+16892226575'] + '+16892226575', + '+48477314848'] print '######### - VALID BY LIBRARY - ################' for l in valid_strings: From d2dfe79f815d2a762f52523b449e13d24b2b7193 Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Thu, 15 Oct 2020 15:11:44 -0700 Subject: [PATCH 08/18] Rename test file --- python/{test.py => dialpad_tests.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename python/{test.py => dialpad_tests.py} (100%) diff --git a/python/test.py b/python/dialpad_tests.py similarity index 100% rename from python/test.py rename to python/dialpad_tests.py From 655a2c7e1f076bf40621bdf19ee52a3fe7a022bf Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Tue, 26 Jan 2021 23:41:07 -0800 Subject: [PATCH 09/18] TEL-13057 - Supporting new Number format for Ivory Coast Summary: Picked these regex changes from the build branch of Google. https://github.com/google/libphonenumber/blob/bc215578007c2a985a37f20597a5067744dca6b9/javascript/i18n/phonenumbers/metadatalite.js The changes will take time to make it through the google release and the david's phone numbers lib. For the migration on Jan 31st we need to push this lib changes for the numbers to be edited and added on product Test Plan: NA Reviewers: nick, jerin Reviewed By: nick Differential Revision: https://phabricator.fspot.us/D15409 --- python/dialpad_tests.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/python/dialpad_tests.py b/python/dialpad_tests.py index 237a2f1d5..54fef0fb0 100644 --- a/python/dialpad_tests.py +++ b/python/dialpad_tests.py @@ -18,22 +18,25 @@ print '######### - VALID BY LIBRARY - ################' for l in valid_strings: x = phonenumbers.parse(l, None) - print (x), '%10s' % phonenumbers.is_valid_number(x) - + print '%15s' % l, '%10s' % phonenumbers.is_valid_number(x), '%25s' % x # To be fixed by Dialpad Changes -dialpad_cases = ['+6278033212174', # https://switchcomm.atlassian.net/browse/DP-13742 - '+63283168971', # Philipines - '+8031000000141', # Dialpadistan +dialpad_cases = ['+6278033212174', # https://switchcomm.atlassian.net/browse/DP-13742 + '+63283168971', # Philipines + '+8031000000141', # Dialpadistan + '+22557715034', # Ivory Coast - Old Format + '+2250757715034', # Ivory Coast - New Format + '+22521214601', # Ivory Coast - Old Format + '+2252721214601', # Ivory Coast - New Format ] print '######### - VALID BY DIALPAD - ################' for l in dialpad_cases: try: x = phonenumbers.parse(l, None) - print (x), '%10s' % phonenumbers.is_valid_number(x) + print '%15s' % l, '%10s' % phonenumbers.is_valid_number(x), '%25s' % x except Exception as e: - print (l), '%10s' % (e) + print '%15s' % l, '%25s' % (e) # Invalid Strings invalid_strings = ['+4916190899790', # https://switchcomm.atlassian.net/browse/TEL-8824 Not Fixed @@ -44,7 +47,7 @@ print '######### - INVALID NUMBERS - ################' for l in invalid_strings: x = phonenumbers.parse(l, None) - print (x), '%10s' % phonenumbers.is_valid_number(x) + print '%15s' % l, '%10s' % phonenumbers.is_valid_number(x), '%25s' % x # National Format match national_format_match = {'+525547808256': '55 4780 8256'} @@ -65,4 +68,5 @@ for l in number_validity_check: region = number_validity_check[l] x = phonenumbers.parse(l, region) - print (x), 'Region : %s -> %10s' % (region, phonenumbers.is_valid_number(x)) + print '%15s' % l, '%10s -> Region : %5s' % (phonenumbers.is_valid_number(x), region) + From 0c2ed910dfe5429bb8dd1a2239673c1224022d86 Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Tue, 13 Jul 2021 16:09:59 -0700 Subject: [PATCH 10/18] Quarterly update --- python/dialpad_tests.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/python/dialpad_tests.py b/python/dialpad_tests.py index 54fef0fb0..e605bae17 100644 --- a/python/dialpad_tests.py +++ b/python/dialpad_tests.py @@ -1,8 +1,7 @@ import phonenumbers # Fixed by Phonenumbers Cases -valid_strings = ['+6323168971', - '+442083661177', +valid_strings = ['+442083661177', '+658003211137', '+20573925008', '+2057392500', @@ -13,7 +12,11 @@ '+525547808256', '+13677395285', '+16892226575', - '+48477314848'] + '+18404440531', + '+48477314848', + '+6569786318', + '+6560115374', # https://switchcomm.atlassian.net/browse/TEL-14616 + ] print '######### - VALID BY LIBRARY - ################' for l in valid_strings: @@ -21,13 +24,11 @@ print '%15s' % l, '%10s' % phonenumbers.is_valid_number(x), '%25s' % x # To be fixed by Dialpad Changes -dialpad_cases = ['+6278033212174', # https://switchcomm.atlassian.net/browse/DP-13742 - '+63283168971', # Philipines - '+8031000000141', # Dialpadistan - '+22557715034', # Ivory Coast - Old Format - '+2250757715034', # Ivory Coast - New Format - '+22521214601', # Ivory Coast - Old Format - '+2252721214601', # Ivory Coast - New Format +dialpad_cases = ['+6278033212174', # https://switchcomm.atlassian.net/browse/DP-13742 + '+63283168971', # Philipines + '+8031000000141', # Dialpadistan + '+2250757715034', # Ivory Coast - New Format + '+2252721214601', # Ivory Coast - New Format ] print '######### - VALID BY DIALPAD - ################' @@ -36,7 +37,7 @@ x = phonenumbers.parse(l, None) print '%15s' % l, '%10s' % phonenumbers.is_valid_number(x), '%25s' % x except Exception as e: - print '%15s' % l, '%25s' % (e) + print '%15s' % l, '%25s' % e # Invalid Strings invalid_strings = ['+4916190899790', # https://switchcomm.atlassian.net/browse/TEL-8824 Not Fixed From 841287222c58315fb2099e27f56054b6c3525149 Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Mon, 6 Sep 2021 23:51:52 -0700 Subject: [PATCH 11/18] New Colombia format --- python/dialpad_tests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/dialpad_tests.py b/python/dialpad_tests.py index e605bae17..60462dbe5 100644 --- a/python/dialpad_tests.py +++ b/python/dialpad_tests.py @@ -16,6 +16,8 @@ '+48477314848', '+6569786318', '+6560115374', # https://switchcomm.atlassian.net/browse/TEL-14616 + '+576015088865', # https://switchcomm.atlassian.net/browse/TEL-14616 + '+5715088865', # https://switchcomm.atlassian.net/browse/TEL-14616 ] print '######### - VALID BY LIBRARY - ################' From f9ff772f89313ac467a1ddbb133b3dbb092d5737 Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Mon, 13 Sep 2021 23:10:33 -0700 Subject: [PATCH 12/18] Fixing the Unit Tests for Region Dialpadistan --- python/phonenumbers/data/region_DP.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/phonenumbers/data/region_DP.py b/python/phonenumbers/data/region_DP.py index 832109f9a..b4b7e94cc 100644 --- a/python/phonenumbers/data/region_DP.py +++ b/python/phonenumbers/data/region_DP.py @@ -2,7 +2,7 @@ from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_DP = PhoneMetadata(id='DP', country_code=803, international_prefix=None, - general_desc=PhoneNumberDesc(national_number_pattern='\\d{10}', possible_length=(10,)), - voip=PhoneNumberDesc(national_number_pattern='\\d{10}', possible_length=(10,)), + general_desc=PhoneNumberDesc(national_number_pattern='\\d{10}', example_number='1000000141', possible_length=(10,)), + voip=PhoneNumberDesc(national_number_pattern='\\d{10}', example_number='1000000141', possible_length=(10,)), number_format=[NumberFormat(pattern='(\\d{3})(\\d{7})', format='\\1\\2')], leading_zero_possible=False) From 5edcba215d0a774bd9a95d24526034c42eac662f Mon Sep 17 00:00:00 2001 From: Hassan Shafiq <91289130+hassan-dialpad@users.noreply.github.com> Date: Thu, 17 Nov 2022 19:53:08 -0500 Subject: [PATCH 13/18] fix for https://dialpad.atlassian.net/browse/DP-60739 --- python/dialpad_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/dialpad_tests.py b/python/dialpad_tests.py index 60462dbe5..ec648158c 100644 --- a/python/dialpad_tests.py +++ b/python/dialpad_tests.py @@ -17,7 +17,7 @@ '+6569786318', '+6560115374', # https://switchcomm.atlassian.net/browse/TEL-14616 '+576015088865', # https://switchcomm.atlassian.net/browse/TEL-14616 - '+5715088865', # https://switchcomm.atlassian.net/browse/TEL-14616 + '+16562013774', # https://dialpad.atlassian.net/browse/DP-60739 ] print '######### - VALID BY LIBRARY - ################' From 12d212d22fd6b6926d29e8b05332354e97f30e22 Mon Sep 17 00:00:00 2001 From: JerinDialpad <43014640+JerinDialpad@users.noreply.github.com> Date: Tue, 21 Mar 2023 11:54:50 -0700 Subject: [PATCH 14/18] DP-67544:Issue with phone numbers not showing in CSR, but are in FST --- python/dialpad_tests.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/python/dialpad_tests.py b/python/dialpad_tests.py index ec648158c..5637a6edc 100644 --- a/python/dialpad_tests.py +++ b/python/dialpad_tests.py @@ -18,12 +18,14 @@ '+6560115374', # https://switchcomm.atlassian.net/browse/TEL-14616 '+576015088865', # https://switchcomm.atlassian.net/browse/TEL-14616 '+16562013774', # https://dialpad.atlassian.net/browse/DP-60739 + '+18352010583', # https://dialpad.atlassian.net/browse/DP-67544 + '+15572003655' # https://dialpad.atlassian.net/browse/DP-67544 ] -print '######### - VALID BY LIBRARY - ################' +print ('######### - VALID BY LIBRARY - ################') for l in valid_strings: x = phonenumbers.parse(l, None) - print '%15s' % l, '%10s' % phonenumbers.is_valid_number(x), '%25s' % x + print ('%15s' % l, '%10s' % phonenumbers.is_valid_number(x), '%25s' % x) # To be fixed by Dialpad Changes dialpad_cases = ['+6278033212174', # https://switchcomm.atlassian.net/browse/DP-13742 @@ -33,13 +35,13 @@ '+2252721214601', # Ivory Coast - New Format ] -print '######### - VALID BY DIALPAD - ################' +print ('######### - VALID BY DIALPAD - ################') for l in dialpad_cases: try: x = phonenumbers.parse(l, None) - print '%15s' % l, '%10s' % phonenumbers.is_valid_number(x), '%25s' % x + print ('%15s' % l, '%10s' % phonenumbers.is_valid_number(x), '%25s' % x) except Exception as e: - print '%15s' % l, '%25s' % e + print ('%15s' % l, '%25s' % e) # Invalid Strings invalid_strings = ['+4916190899790', # https://switchcomm.atlassian.net/browse/TEL-8824 Not Fixed @@ -47,15 +49,15 @@ '+205739250', ] -print '######### - INVALID NUMBERS - ################' +print ('######### - INVALID NUMBERS - ################') for l in invalid_strings: x = phonenumbers.parse(l, None) - print '%15s' % l, '%10s' % phonenumbers.is_valid_number(x), '%25s' % x + print ('%15s' % l, '%10s' % phonenumbers.is_valid_number(x), '%25s' % x) # National Format match national_format_match = {'+525547808256': '55 4780 8256'} -print '######### - NUMBER FORMAT VALIDITY - ################' +print ('######### - NUMBER FORMAT VALIDITY - ################') for l in national_format_match: x = phonenumbers.parse(l, None) y = phonenumbers.format_number(x, phonenumbers.PhoneNumberFormat.NATIONAL) @@ -67,9 +69,9 @@ # Number validity check number_validity_check = {'1932621160': 'BR'} -print '######### - REGION NUMBER VALIDITY - ###############' +print ('######### - REGION NUMBER VALIDITY - ###############') for l in number_validity_check: region = number_validity_check[l] x = phonenumbers.parse(l, region) - print '%15s' % l, '%10s -> Region : %5s' % (phonenumbers.is_valid_number(x), region) + print ('%15s' % l, '%10s -> Region : %5s' % (phonenumbers.is_valid_number(x), region)) From ed17edc5e5733a85ed0dc922bbc06e7c65a649fc Mon Sep 17 00:00:00 2001 From: JerinDialpad <43014640+JerinDialpad@users.noreply.github.com> Date: Tue, 13 Jun 2023 17:29:35 -0700 Subject: [PATCH 15/18] Add test --- python/dialpad_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/dialpad_tests.py b/python/dialpad_tests.py index 5637a6edc..f040fa4bc 100644 --- a/python/dialpad_tests.py +++ b/python/dialpad_tests.py @@ -19,7 +19,8 @@ '+576015088865', # https://switchcomm.atlassian.net/browse/TEL-14616 '+16562013774', # https://dialpad.atlassian.net/browse/DP-60739 '+18352010583', # https://dialpad.atlassian.net/browse/DP-67544 - '+15572003655' # https://dialpad.atlassian.net/browse/DP-67544 + '+15572003655', # https://dialpad.atlassian.net/browse/DP-67544 + '+61493772332', # https://dialpad.atlassian.net/browse/DP-73324 ] print ('######### - VALID BY LIBRARY - ################') From 9f93d045397946359ab2d6a7b9982b00ca205999 Mon Sep 17 00:00:00 2001 From: Ariel Ickowicz Date: Mon, 18 Dec 2023 23:19:08 -0300 Subject: [PATCH 16/18] Add DP test for area code 329 --- python/dialpad_tests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/dialpad_tests.py b/python/dialpad_tests.py index f040fa4bc..e6bbc950f 100644 --- a/python/dialpad_tests.py +++ b/python/dialpad_tests.py @@ -21,6 +21,7 @@ '+18352010583', # https://dialpad.atlassian.net/browse/DP-67544 '+15572003655', # https://dialpad.atlassian.net/browse/DP-67544 '+61493772332', # https://dialpad.atlassian.net/browse/DP-73324 + '+13292010961', # https://dialpad.atlassian.net/browse/TEL-21003 ] print ('######### - VALID BY LIBRARY - ################') From 6889e1c3daebc4dfd312e17e88936a703b939208 Mon Sep 17 00:00:00 2001 From: Ariel Ickowicz Date: Thu, 28 Dec 2023 00:46:41 -0300 Subject: [PATCH 17/18] Support new prefix for Nigeria --- python/dialpad_tests.py | 4 +++- python/phonenumbers/data/region_NG.py | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/python/dialpad_tests.py b/python/dialpad_tests.py index e6bbc950f..20e2eff6f 100644 --- a/python/dialpad_tests.py +++ b/python/dialpad_tests.py @@ -34,7 +34,9 @@ '+63283168971', # Philipines '+8031000000141', # Dialpadistan '+2250757715034', # Ivory Coast - New Format - '+2252721214601', # Ivory Coast - New Format + '+2252721214601', # Ivory Coast - New Format, + '+2342012278701', # Nigeria, new format https://dialpad.atlassian.net/browse/TEL-21006 + '+23412278701', # Nigeria, old format for backwards comp ] print ('######### - VALID BY DIALPAD - ################') diff --git a/python/phonenumbers/data/region_NG.py b/python/phonenumbers/data/region_NG.py index 5065fc666..d0a47ec2c 100644 --- a/python/phonenumbers/data/region_NG.py +++ b/python/phonenumbers/data/region_NG.py @@ -2,9 +2,9 @@ from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_NG = PhoneMetadata(id='NG', country_code=234, international_prefix='009', - general_desc=PhoneNumberDesc(national_number_pattern='38\\d{6}|[78]\\d{9,13}|(?:20|9\\d)\\d{8}', possible_length=(8, 10, 11, 12, 13, 14), possible_length_local_only=(6, 7)), - fixed_line=PhoneNumberDesc(national_number_pattern='(?:20(?:[1259]\\d|3[013-9]|4[1-8]|6[024-689]|7[1-79]|8[2-9])|38)\\d{6}', example_number='2033123456', possible_length=(8, 10), possible_length_local_only=(6, 7)), - mobile=PhoneNumberDesc(national_number_pattern='(?:702[0-24-9]|819[01])\\d{6}|(?:7(?:0[13-9]|[12]\\d)|8(?:0[1-9]|1[0-8])|9(?:0[1-9]|1[1-6]))\\d{7}', example_number='8021234567', possible_length=(10,)), + general_desc=PhoneNumberDesc(national_number_pattern='(?:20)?((?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13})|(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}', possible_length=(7, 8, 10, 11, 12, 13, 14), possible_length_local_only=(5, 6, 8)), + fixed_line=PhoneNumberDesc(national_number_pattern='(?:20)?((?:(?:[1-356]\\d|4[02-8]|8[2-9])\\d|9(?:0[3-9]|[1-9]\\d))\\d{5}|7(?:0(?:[013-689]\\d|2[0-24-9])\\d{3,4}|[1-79]\\d{6})|(?:[12]\\d|4[147]|5[14579]|6[1578]|7[1-3578])\\d{5})|(?:(?:[1-356]\\d|4[02-8]|8[2-9])\\d|9(?:0[3-9]|[1-9]\\d))\\d{5}|7(?:0(?:[013-689]\\d|2[0-24-9])\\d{3,4}|[1-79]\\d{6})|(?:[12]\\d|4[147]|5[14579]|6[1578]|7[1-3578])\\d{5}', example_number='18040123', possible_length=(7, 8, 10), possible_length_local_only=(5, 6, 8)), + mobile=PhoneNumberDesc(national_number_pattern='(?:702[0-24-9]|819[01])\\d{6}|(?:70[13-689]|8(?:0[1-9]|1[0-8])|9(?:0[1-9]|1[1-356]))\\d{7}', example_number='8021234567', possible_length=(10,)), toll_free=PhoneNumberDesc(national_number_pattern='800\\d{7,11}', example_number='80017591759', possible_length=(10, 11, 12, 13, 14)), uan=PhoneNumberDesc(national_number_pattern='700\\d{7,11}', example_number='7001234567', possible_length=(10, 11, 12, 13, 14)), national_prefix='0', From 88430180abdce00fd75cca6166b6ef61d8f39293 Mon Sep 17 00:00:00 2001 From: Ariel Ickowicz Date: Mon, 26 Feb 2024 13:17:16 -0300 Subject: [PATCH 18/18] Area code 728 --- python/dialpad_tests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/dialpad_tests.py b/python/dialpad_tests.py index 20e2eff6f..0df784f98 100644 --- a/python/dialpad_tests.py +++ b/python/dialpad_tests.py @@ -22,6 +22,7 @@ '+15572003655', # https://dialpad.atlassian.net/browse/DP-67544 '+61493772332', # https://dialpad.atlassian.net/browse/DP-73324 '+13292010961', # https://dialpad.atlassian.net/browse/TEL-21003 + '+17282011957', # https://dialpad.atlassian.net/browse/TEL-21287 ] print ('######### - VALID BY LIBRARY - ################')