From b4d235639d427d689745a5b98590a25d7dcb1f44 Mon Sep 17 00:00:00 2001 From: Jordan Nichole Whitaker Date: Fri, 17 Nov 2023 01:53:53 +0000 Subject: [PATCH] Updated to detect false positives --- test_team_technigals.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test_team_technigals.py b/test_team_technigals.py index 36796cd..e540b81 100644 --- a/test_team_technigals.py +++ b/test_team_technigals.py @@ -55,6 +55,13 @@ def test_detect_usernames(self): # Test an invalid organization invalid_result = analyze_text('John Smith') self.assertNotIn("USERNAME", str(invalid_result), "Invalid organization incorrectly detected") + + # Test a potential false positive + potential_false_positive_result = analyze_text('@legitimate_org') + username_occurrences = str(potential_false_positive_result).count("USERNAME") + + # Check for false positives (adjust the threshold as needed) + self.assertEqual(username_occurrences, 1, "False positive username detection") def test_zipcode(self): """Test to find zipcode of user"""