diff options
| author | Alex Schofield <git@ajschof.me> | 2025-02-17 16:01:46 +0000 |
|---|---|---|
| committer | Alex Schofield <git@ajschof.me> | 2025-02-17 16:01:52 +0000 |
| commit | 227b6a86d3658845441d13779d147d8892216618 (patch) | |
| tree | 296bfb3d6b95f277d65e4e4358b7bf5fec8b2385 | |
| parent | 7a4057196cb9282355b1eff6f06ee5a3c33e4e67 (diff) | |
| download | gdpr-obfuscator-227b6a86d3658845441d13779d147d8892216618.tar.gz gdpr-obfuscator-227b6a86d3658845441d13779d147d8892216618.zip | |
add expected outputs and more detail to test descriptions in test_obfuscator
| -rw-r--r-- | test/test_obfuscator.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/test_obfuscator.py b/test/test_obfuscator.py index 0245a26..cc7d2c1 100644 --- a/test/test_obfuscator.py +++ b/test/test_obfuscator.py @@ -1,7 +1,7 @@ from obfuscator.obfuscate import obfuscate -# Check if the function can obfuscate valid PII fields in a list -# of dictionaries +# Check if the function does what its supposed to and can obfuscate +# valid PII fields in a list of dictionaries def test_obfuscate_data_with_valid_pii_fields(): data = [ { @@ -37,7 +37,8 @@ def test_obfuscate_data_with_valid_pii_fields(): assert result == expected # Check if the function can obfuscate data even when some PII -# fields are missing from some of the data +# fields are missing from some of the data, returning a list of dictionaries +# but with the missing PII fields obfuscated and the rest of the data intact def test_obfuscate_data_with_missing_pii_field(): data = [ {"student_id": "1234", "name": "John Smith", "course": "Software"}, @@ -62,7 +63,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 +# Check if the function can handle an empty list of data, returning an empty list def test_obfuscate_data_with_no_data(): data = [] pii_fields = ["name", "email_address"] @@ -71,7 +72,8 @@ 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 +# Check if the function can handle an empty list of PII fields, returning the data as is +# without mutating it def test_obfuscate_data_with_empty_pii_fields(): data = [ { |
