def test_should_ignore_nan_secondary_email_address(self): assert extract_distinct_emails_from_data_frame(pd.DataFrame([{ 'email': np.nan, 'secondary_email': np.nan }])) == set()
def test_should_strip_spaces_and_ignore_blank(self): assert extract_distinct_emails_from_data_frame(pd.DataFrame([{ 'email': ' ', 'secondary_email': ' %s ' % EMAIL_2 }])) == {EMAIL_2}
def test_should_ignore_blank_secondary_email_address(self): assert extract_distinct_emails_from_data_frame(pd.DataFrame([{ 'email': EMAIL_1, 'secondary_email': '' }])) == {EMAIL_1}
def test_should_extract_secondary_email_address_if_column_present(self): assert extract_distinct_emails_from_data_frame(pd.DataFrame([{ 'email': EMAIL_1, 'secondary_email': EMAIL_2 }])) == {EMAIL_1, EMAIL_2}
def test_should_extract_primary_email_address_only_once(self): assert extract_distinct_emails_from_data_frame(pd.DataFrame([{ 'email': EMAIL_1 }, { 'email': EMAIL_1 }])) == {EMAIL_1}
def test_should_extract_multiple_primary_email_addresses(self): assert extract_distinct_emails_from_data_frame(pd.DataFrame([{ 'email': EMAIL_1 }, { 'email': EMAIL_2 }])) == {EMAIL_1, EMAIL_2}