Renamed the header of the CSV to 'to' from 'number' to allow for email jobs

- added new columns to Job and Notification to capture the start/end dates accurately
This commit is contained in:
Martyn Inglis
2016-02-25 09:59:50 +00:00
parent b3884e2d6c
commit 10a764a2c1
16 changed files with 271 additions and 80 deletions

View File

@@ -1,15 +1,28 @@
from app.csv import get_mobile_numbers_from_csv
from app.csv import get_recipient_from_csv
from tests.app import load_example_csv
def test_should_process_single_phone_number_file():
sms_file = load_example_csv('sms')
len(get_mobile_numbers_from_csv(sms_file)) == 1
assert get_mobile_numbers_from_csv(sms_file)[0] == '+441234123123'
len(get_recipient_from_csv(sms_file)) == 1
assert get_recipient_from_csv(sms_file)[0] == '+441234123123'
def test_should_process_multple_phone_number_file_in_order():
sms_file = load_example_csv('multiple_sms')
len(get_mobile_numbers_from_csv(sms_file)) == 10
assert get_mobile_numbers_from_csv(sms_file)[0] == '+441234123121'
assert get_mobile_numbers_from_csv(sms_file)[9] == '+441234123120'
len(get_recipient_from_csv(sms_file)) == 10
assert get_recipient_from_csv(sms_file)[0] == '+441234123121'
assert get_recipient_from_csv(sms_file)[9] == '+441234123120'
def test_should_process_single_email_file():
sms_file = load_example_csv('email')
len(get_recipient_from_csv(sms_file)) == 1
assert get_recipient_from_csv(sms_file)[0] == 'test@test.com'
def test_should_process_multple_email_file_in_order():
sms_file = load_example_csv('multiple_email')
len(get_recipient_from_csv(sms_file)) == 10
assert get_recipient_from_csv(sms_file)[0] == 'test1@test.com'
assert get_recipient_from_csv(sms_file)[9] == 'test0@test.com'