From dca768b76df85d1ef626bd72d9eea59793cb29b0 Mon Sep 17 00:00:00 2001 From: Caleb Boyce Date: Thu, 31 Oct 2024 21:50:42 +0000 Subject: [PATCH] Added US_DRIVER_LICENSE test case --- test_team_techtitans.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test_team_techtitans.py b/test_team_techtitans.py index 92c4b7d..d587412 100644 --- a/test_team_techtitans.py +++ b/test_team_techtitans.py @@ -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""" @@ -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: