Skip to content

Commit

Permalink
feat: added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrinson-rise8 committed Jan 10, 2025
1 parent ca9944c commit 16f8aaa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/unit/schemas/test_pii.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,11 @@ def test_blocking_keys_birthdate(self):
def test_blocking_keys_mrn_last_four(self):
rec = pii.PIIRecord()
assert rec.blocking_keys(BlockingKey.IDENTIFIER) == set()
rec = pii.PIIRecord(identifiers=[])
rec = pii.PIIRecord(**{"identifiers": []})
assert rec.blocking_keys(BlockingKey.IDENTIFIER) == set()
rec = pii.PIIRecord(identifiers=[pii.Identifier(type="MR", value="123456789")])
rec = pii.PIIRecord(**{"identifiers": [{ "type": "MR", "value": "123456789" }]})
assert rec.blocking_keys(BlockingKey.IDENTIFIER) == {"MR::6789"}
rec = pii.PIIRecord(identifiers=[pii.Identifier(type="MR", value="89")])
rec = pii.PIIRecord(**{"identifiers": [{ "type": "MR", "value": "89" }]})
assert rec.blocking_keys(BlockingKey.IDENTIFIER) == {"MR::89"}

#test multiple identifiers return correctly
Expand Down Expand Up @@ -433,6 +433,8 @@ def test_blocking_keys_identifier(self):
assert rec.blocking_keys(BlockingKey.IDENTIFIER) == set()
rec = pii.PIIRecord(**{"identifiers": [{"type": "MR", "value": "123456789", "authority": "NY"}]})
assert rec.blocking_keys(BlockingKey.IDENTIFIER) == {"MR:NY:6789"}

#test only get first 2 characters of authority for blocking
rec = pii.PIIRecord(**{"identifiers": [{"type": "MR", "value": "123456789", "authority": "DMV"}]})
assert rec.blocking_keys(BlockingKey.IDENTIFIER) == {"MR:DM:6789"}

Expand Down

0 comments on commit 16f8aaa

Please sign in to comment.