-
Notifications
You must be signed in to change notification settings - Fork 30
Update test_team_sei.py #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| @@ -22,7 +22,23 @@ def test_find_us_ssn(self): | |||
| def test_find_email(self): | |||
| results_list = find_email('My email address is jim.jones@jones.com') | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ^ in your regex will only match at the beginning of the string. You need to remove the ^ in order to match the email in this string.
re.findall(r'^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+', text)
| @@ -22,7 +22,23 @@ def test_find_us_ssn(self): | |||
| def test_find_email(self): | |||
| results_list = find_email('My email address is jim.jones@jones.com') | |||
| self.assertEqual(results_list, []) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After you correct the regex, this should be
self.assertEqual(results_list[0], 'jim.jones@jones.com')
|
|
||
| #test an email given at the end of string | ||
| results_list = find_email("My email address is jim.jones@jones.com") | ||
| self.assertEqual(results_list[1],'jim.jones@jones.com') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
results_list is zero based so this should be
self.assertEqual(results_list[0],'jim.jones@jones.com')
No description provided.