Spaces:
Runtime error
Runtime error
Download tests/test_redact_pii.py from 1337XCode/personabot-api: direct link, hf CLI and curl.
- Browser
- Download file 477 Bytes
-
https://huggingface.co/spaces/1337XCode/personabot-api/resolve/main/tests/test_redact_pii.py
- Command line
-
hf download hf://spaces/1337XCode/personabot-api/tests/test_redact_pii.py
-
curl -L -o test_redact_pii.py https://huggingface.co/spaces/1337XCode/personabot-api/resolve/main/tests/test_redact_pii.py
477 Bytes
| from app.security.sanitizer import redact_pii | |
| def test_the_published_contact_address_is_kept_and_other_contact_details_are_not() -> None: | |
| redacted = redact_pii("Email me@darshanchheda.com or Me@DarshanChheda.com, not dchheda111@gmail.com or +44 7818 975908.") | |
| assert redacted.startswith("Email me@darshanchheda.com or Me@DarshanChheda.com, not [REDACTED] or ") | |
| assert "gmail" not in redacted | |
| assert "7818" not in redacted | |
| assert "975908" not in redacted | |