Skip to content
Open
Changes from 2 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
51 changes: 32 additions & 19 deletions test_team_futureassured.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import unittest
from pii_scan import anonymize_text


class TestTeamFutureAssured(unittest.TestCase):
"""Test the Team TeamFutureAssured PII functions"""
def test_anonymize_text(self):
Expand Down Expand Up @@ -48,23 +47,37 @@ def test_it_driver_license(self):
actual = anonymize_text(test_string, ['IT_DRIVER_LICENSE'])
self.assertEqual(expected, actual)
def test_au_abn(self):
"""Test au_abn functionality"""

#positive testcase
test_string = "My ABN is 51824753556"
expected = "My ABN is <AU_ABN>"
actual = anonymize_text(test_string, ["AU_ABN"])
self.assertEqual(expected,actual)

def test_au_medicare(self):
"""Test au_medicare functionality"""
#format
#First digit and must be in the range 2–6
#8th digit is check sum
#Last digit (issue number) and can't be 0
#positive test case example
test_string = 'My AU Medicare Number is 2835467857'
expected = 'My AU Medicare Number is <AU_MEDICARE>'
actual = anonymize_text(test_string, ['AU_MEDICARE'])
self.assertEqual(expected, actual)
#negative testcase
test_string = "My ABN is 1234334345678"
expected = "My ABN is <AU_ABN>"
actual = anonymize_text(test_string, ["AU_ABN"])
self.assertNotEqual(expected,actual)

#negative test case example
#check sum digit is not calculated correctly in this example
test_string = 'My AU Medicare Number is 2835467897'
expected = 'My AU Medicare Number is 2835467897'
actual = anonymize_text(test_string, ['AU_MEDICARE'])
self.assertEqual(expected, actual)



# def test_au_medicare(self):
# """Test au_medicare functionality"""
# #format
# #First digit and must be in the range 2–6
# #8th digit is check sum
# #Last digit (issue number) and can't be 0
# #positive test case example
# test_string = 'My AU Medicare Number is 2835467857'
# expected = 'My AU Medicare Number is <AU_MEDICARE>'
# actual = anonymize_text(test_string, ['AU_MEDICARE'])
# self.assertEqual(expected, actual)

# #negative test case example
# #check sum digit is not calculated correctly in this example
# test_string = 'My AU Medicare Number is 2835467897'
# expected = 'My AU Medicare Number is 2835467897'
# actual = anonymize_text(test_string, ['AU_MEDICARE'])
# self.assertEqual(expected, actual)