From 2615b812b2fca137e8baf57723e5f78048086292 Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Mon, 26 Aug 2019 16:11:48 -0700 Subject: [PATCH 01/19] 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 b14632002682cc4b6e0f3c21c49e2f54c3816c6b Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Mon, 26 Aug 2019 16:12:33 -0700 Subject: [PATCH 02/19] 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 709fb993ba58492fc59d0792599795783d8a64fc Mon Sep 17 00:00:00 2001 From: Corey Burke Date: Tue, 31 Jul 2018 09:09:04 -0700 Subject: [PATCH 03/19] 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 db01672a7fd9cbf420e437157d756634591d37ec Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Tue, 11 Feb 2020 19:46:09 -0800 Subject: [PATCH 04/19] 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 ea1944a881110d32823c006402163e158fad6346 Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Wed, 1 Jul 2020 14:36:10 -0700 Subject: [PATCH 05/19] 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 b4837e5abeedc928987d78db5c3d26fc69e0221a Mon Sep 17 00:00:00 2001 From: Dana Hoffmann Date: Thu, 20 Sep 2018 10:52:05 -0700 Subject: [PATCH 06/19] 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 bc11ff632a52a9de4efaad093c7a928b86be08a7 Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Thu, 15 Oct 2020 00:10:57 -0700 Subject: [PATCH 07/19] 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 2342104fb727a2f5c49ba1db78633a0d23644a28 Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Thu, 15 Oct 2020 15:11:44 -0700 Subject: [PATCH 08/19] 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 7546e2225a2f79e15733e4fec3ba00f23b546b8b Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Tue, 26 Jan 2021 23:41:07 -0800 Subject: [PATCH 09/19] 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 76a15917ecbbb9cc90cdf4ac6cb682f005453860 Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Tue, 13 Jul 2021 16:09:59 -0700 Subject: [PATCH 10/19] 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 830d59a3dbf1341c950bdaf2472785bc3952435a Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Mon, 6 Sep 2021 23:51:52 -0700 Subject: [PATCH 11/19] 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 c1f738886e75c72224c70277f8662d3084b1c1a2 Mon Sep 17 00:00:00 2001 From: Rajesh Panicker Date: Mon, 13 Sep 2021 23:10:33 -0700 Subject: [PATCH 12/19] 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 9f53bd909a6de10c78b35b314dee9c3d21e2a789 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/19] 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 3ee7cc0ea9e21b3cf9b54f498fbcb6615a2b9e33 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/19] 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 d14719e1381592cb764ef3278cc7dda8da2ae0ea 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/19] 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 2881171dfe7e11270fcceb6df610cf5e83577139 Mon Sep 17 00:00:00 2001 From: Ariel Ickowicz Date: Mon, 18 Dec 2023 23:19:08 -0300 Subject: [PATCH 16/19] 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 203bc074dfad638fe2a7b2e1edbaa2f4ce6c7d27 Mon Sep 17 00:00:00 2001 From: Ariel Ickowicz Date: Thu, 28 Dec 2023 00:46:41 -0300 Subject: [PATCH 17/19] 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 77bada925a8d5f6d197244bb47b48c80c87530c5 Mon Sep 17 00:00:00 2001 From: Ariel Ickowicz Date: Mon, 26 Feb 2024 13:17:16 -0300 Subject: [PATCH 18/19] 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 - ################') From c5e0f77e4a444bca88eb67fc0c1adaf40b084256 Mon Sep 17 00:00:00 2001 From: Pablo Montepagano Date: Fri, 27 Dec 2024 17:10:30 -0300 Subject: [PATCH 19/19] Add test for TEL-23411 --- python/dialpad_tests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/dialpad_tests.py b/python/dialpad_tests.py index 0df784f98..dd4879b08 100644 --- a/python/dialpad_tests.py +++ b/python/dialpad_tests.py @@ -23,6 +23,7 @@ '+61493772332', # https://dialpad.atlassian.net/browse/DP-73324 '+13292010961', # https://dialpad.atlassian.net/browse/TEL-21003 '+17282011957', # https://dialpad.atlassian.net/browse/TEL-21287 + '+17302559291', # https://dialpad.atlassian.net/browse/TEL-23411 ] print ('######### - VALID BY LIBRARY - ################')