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
20 changes: 20 additions & 0 deletions test_team_tech_baddies.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,27 @@ def test_in_vehicle_registration(self):
self.assertListEqual([], result)
def test_in_voter(self):
"""Test IN_VOTER functionality"""
begin = ['AAA']
ending = ['0000000']

# Positive Test Case
for b in begin:
for e in ending:
number = ''.join([b,e])
# Check context score should be 0.75
result = analyze_text('My Voter ID is ' + number, ['IN_VOTER'])
print(result)
self.assertEqual('IN_VOTER', result[0].entity_type)
self.assertEqual(0.75, result[0].score)

# Check no context
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

voter is a context word for IN_VOTER according to the opensource - so I don't see how this is a check for no context as stated in the comment.

result = analyze_text('My number is ' + number, ['IN_VOTER'])
self.assertEqual('IN_VOTER', result[0].entity_type)
self.assertEqual(0.4, result[0].score)

# Negative Test Case
result = analyze_text('My Voter ID is AAA00000', ['IN_VOTER'])
self.assertListEqual([], result)

if __name__ == '__main__':
unittest.main()