Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions test_team_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,20 @@ def test_date_time(self):
"""Test DATE_TIME functionality"""

def test_email_address(self):
#Ari Rozier: Team 2
"""Test EMAIL_ADDRESS functionality"""
# positive test case
result = analyze_text('[email protected]', ['EMAIL_ADDRESS'])

#error handeling if more than 1 submission
self.assertEqual(len(result), 1, 'Only 1 submission is expected')
#error handeling if result is NOT an Email Address Type
self.assertEqual(result[0].entity_type, 'EMAIL_ADDRESS', 'Should have found a valid email address. Including the name and domain type.')

#negative test case
result = analyze_text('example123.com', ['EMAIL_ADDRESS'])
#error handeling if more than 1 submission
self.assertEqual(len(result), 0, 'There shouldnt be anything in the user test case')


if __name__ == '__main__':
Expand Down