mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-13 00:32:16 -05:00
add tests
This commit is contained in:
@@ -402,7 +402,12 @@ def extract_phones(job):
|
|||||||
phone_index = 0
|
phone_index = 0
|
||||||
for item in first_row:
|
for item in first_row:
|
||||||
# Note: may contain a BOM and look like \ufeffphone number
|
# Note: may contain a BOM and look like \ufeffphone number
|
||||||
if item.lower() in ["phone number", "\\ufeffphone number", "phone number\n"]:
|
if item.lower() in [
|
||||||
|
"phone number",
|
||||||
|
"\\ufeffphone number",
|
||||||
|
"\\ufeffphone number\n",
|
||||||
|
"phone number\n",
|
||||||
|
]:
|
||||||
break
|
break
|
||||||
phone_index = phone_index + 1
|
phone_index = phone_index + 1
|
||||||
|
|
||||||
|
|||||||
@@ -219,6 +219,16 @@ def test_get_s3_file_makes_correct_call(notify_api, mocker):
|
|||||||
2,
|
2,
|
||||||
"5555555552",
|
"5555555552",
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
# simulate file saved with utf8withbom
|
||||||
|
"\\ufeffPHONE NUMBER\n",
|
||||||
|
"5555555552",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
# simulate file saved without utf8withbom
|
||||||
|
"\\PHONE NUMBER\n",
|
||||||
|
"5555555552",
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_get_phone_number_from_s3(
|
def test_get_phone_number_from_s3(
|
||||||
|
|||||||
Reference in New Issue
Block a user