-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathtest_team_sei.py
42 lines (30 loc) · 1.61 KB
/
test_team_sei.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import unittest
from pii_team_sei import *
class SEITestCases(unittest.TestCase):
def test_find_us_phone_number(self):
results_list = find_us_phone_number('My phone number is 123-456-7890')
self.assertEqual(results_list[0], '123-456-7890') # add assertion here
def test_find_visa_mastercard(self):
#Not matching credit card number
results_list = find_visa_mastercard('My credit card number is 1234-5678-9012-3456')
self.assertEqual(results_list, [])
#Matching Visa credit card number
results_list = find_visa_mastercard('My credit card number is 4234-5678-9012-3456')
self.assertEqual(results_list[0], '4234-5678-9012-3456')
#Matching Mastercard credit card number
results_list = find_visa_mastercard('My credit card number is 5234-5678-9012-3456')
self.assertEqual(results_list[0], '5234-5678-9012-3456')
def test_find_amex(self):
results_list = find_amex('My credit card number is 1234-567890-12345')
self.assertEqual(results_list[0], '1234-567890-12345')
def test_find_us_ssn(self):
results_list = find_us_ssn('My social security number is 123-45-6789')
self.assertEqual(results_list[0], '123-45-6789')
def test_find_email(self):
results_list = find_email('My email address is jim.jones@jones.com')
self.assertEqual(results_list[0], 'jim.jones@jones.com')
def test_find_instagram_handle(self):
results_list = find_instagram_handle('My instagram handle is @jimjones')
self.assertEqual(results_list[0], '@jimjones')
if __name__ == '__main__':
unittest.main()