Skip to content

Commit

Permalink
DP-67544:Issue with phone numbers not showing in CSR, but are in FST
Browse files Browse the repository at this point in the history
  • Loading branch information
JerinDialpad authored and aickowicz-dp committed Dec 19, 2023
1 parent bb8fa88 commit 31ef0ef
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions python/dialpad_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,29 +35,29 @@
'+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
'+2022577744',
'+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)
Expand All @@ -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))

0 comments on commit 31ef0ef

Please sign in to comment.