mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-16 10:12:32 -05:00
more tests
This commit is contained in:
@@ -655,7 +655,7 @@ def test_read_s3_file_populates_cache(monkeypatch):
|
||||
|
||||
@patch("app.aws.s3.current_app")
|
||||
def test_valid_csv(mock_app):
|
||||
csv_data = "Name, Phone Number\nAlice, +1 (555) 555-5555\nBob, 555.555.1111"
|
||||
csv_data = "Name,Phone Number\nAlice,+1 (555) 555-5555\nBob,555.555.1111"
|
||||
result = extract_phones(csv_data, "service1", "job1")
|
||||
expected = {0: "15555555555", 1: "5555551111"}
|
||||
assert result == expected
|
||||
@@ -667,7 +667,7 @@ def test_missing_phone_column(mock_app):
|
||||
|
||||
csv_data = "Name,Phone Number\nAlice,\nBob"
|
||||
result = extract_phones(csv_data, "service1", "job1")
|
||||
assert result == {0: "Unavailable", 1: "Unavailable"}
|
||||
assert result == {0: "", 1: "Unavailable"}
|
||||
mock_app.logger.error.assert_called_once()
|
||||
|
||||
|
||||
@@ -677,3 +677,6 @@ def test_test_with_bom_header(mock_app):
|
||||
result = extract_phones(csv_data, "service2", "job2")
|
||||
expected = {0: "15555555555"}
|
||||
assert result == expected
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_valid_csv()
|
||||
|
||||
Reference in New Issue
Block a user