diff options
| author | Alex Schofield <git@ajschof.me> | 2025-02-17 15:58:14 +0000 |
|---|---|---|
| committer | Alex Schofield <git@ajschof.me> | 2025-02-17 15:58:14 +0000 |
| commit | 4069a46dfb70ca98d8b2dfb671673c41b0f7c2e5 (patch) | |
| tree | d3e74327c6c4949e34a340b69908fc20d1519b94 /test | |
| parent | 3837fb40c1f70fa8bfd65872cc1c85963903fe3a (diff) | |
| download | gdpr-obfuscator-4069a46dfb70ca98d8b2dfb671673c41b0f7c2e5.tar.gz gdpr-obfuscator-4069a46dfb70ca98d8b2dfb671673c41b0f7c2e5.zip | |
add comments for description of obfuscator.py tests
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_obfuscator.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/test_obfuscator.py b/test/test_obfuscator.py index c77b6b4..0245a26 100644 --- a/test/test_obfuscator.py +++ b/test/test_obfuscator.py @@ -1,6 +1,7 @@ from obfuscator.obfuscate import obfuscate - +# Check if the function can obfuscate valid PII fields in a list +# of dictionaries def test_obfuscate_data_with_valid_pii_fields(): data = [ { @@ -35,7 +36,8 @@ def test_obfuscate_data_with_valid_pii_fields(): result = obfuscate(data, pii_fields) assert result == expected - +# Check if the function can obfuscate data even when some PII +# fields are missing from some of the data def test_obfuscate_data_with_missing_pii_field(): data = [ {"student_id": "1234", "name": "John Smith", "course": "Software"}, @@ -60,7 +62,7 @@ def test_obfuscate_data_with_missing_pii_field(): result = obfuscate(data, pii_fields) assert result == expected - +# Check if the function can handle an empty list of data def test_obfuscate_data_with_no_data(): data = [] pii_fields = ["name", "email_address"] @@ -69,7 +71,7 @@ def test_obfuscate_data_with_no_data(): result = obfuscate(data, pii_fields) assert result == expected - +# Check if the function can handle an empty list of PII fields def test_obfuscate_data_with_empty_pii_fields(): data = [ { |
