Skip to content

Commit 6fb883d

Browse files
committed
unit tests for global_helper
1 parent 3bfa2ca commit 6fb883d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

global_helpers/global_helpers_test.py

+28
Original file line numberDiff line numberDiff line change
@@ -2439,5 +2439,33 @@ def test_pantherflow_investigation(self):
24392439
self.assertEqual(p_b_h.pantherflow_investigation(event), query)
24402440

24412441

2442+
class TestEmailRegex(unittest.TestCase):
2443+
def test_email_regex(self):
2444+
email_regex = p_b_h.EMAIL_REGEX
2445+
valid_emails = [
2446+
2447+
2448+
2449+
2450+
2451+
]
2452+
invalid_emails = [
2453+
"asfe@acme",
2454+
2455+
"a@b",
2456+
"a@b.",
2457+
2458+
2459+
2460+
2461+
"asdf@",
2462+
"a.b@g&g.com",
2463+
]
2464+
for email in valid_emails:
2465+
self.assertTrue(email_regex.match(email))
2466+
for email in invalid_emails:
2467+
self.assertFalse(email_regex.match(email))
2468+
2469+
24422470
if __name__ == "__main__":
24432471
unittest.main()

0 commit comments

Comments
 (0)