Skip to content
Open
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
10 changes: 9 additions & 1 deletion test_team_techtitans.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ def test_us_bank_number(self):
def test_us_driver_license(self):
"""Test US_DRIVER_LICENSE functionality"""

# Positive test case with a plain 12-digit Drivers License number
result = analyze_text('My Drivers licnese is 950354535123', ['US_DRIVER_LICENSE'])
print(result)
# Check entity type and confidence score for a weak pattern match
self.assertEqual('US_DRIVER_LICENSE', result[0].entity_type)
self.assertEqual(0.4, result[0].score)


def test_us_itin(self):
"""Test US_ITIN functionality"""

Expand All @@ -27,7 +35,7 @@ def test_us_passport(self):
# Positive test case with a plain 9-digit passport number
result = analyze_text("My passport is 140190332", ["US_PASSPORT"])
print("Result for 'My passport is 140190332':", result)

# Check that the result is not empty before accessing
self.assertTrue(result, "Expected a US_PASSPORT entity but got no results.")
if result:
Expand Down