Spaces:
Sleeping
Sleeping
solidprivacy-nl commited on
Commit ·
222ebb8
1
Parent(s): c4aa6c2
Fix corpus email-domain validator domain check
Browse files
tests/test_recall_gold_label_corpus_seed.py
CHANGED
|
@@ -77,6 +77,7 @@ EXPECTED_GOLD_SIDECARS = {
|
|
| 77 |
}
|
| 78 |
|
| 79 |
EMAIL_RE = re.compile(r"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]*[A-Za-z0-9]")
|
|
|
|
| 80 |
|
| 81 |
|
| 82 |
def _gold_files() -> list[Path]:
|
|
@@ -130,7 +131,8 @@ def test_seed_corpus_uses_reserved_example_email_domain_only():
|
|
| 130 |
|
| 131 |
assert found_emails, "Expected at least one synthetic email fixture in corpus/"
|
| 132 |
for email in found_emails:
|
| 133 |
-
|
|
|
|
| 134 |
|
| 135 |
|
| 136 |
def test_role_and_context_terms_are_preserved_not_sensitive_labels():
|
|
|
|
| 77 |
}
|
| 78 |
|
| 79 |
EMAIL_RE = re.compile(r"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]*[A-Za-z0-9]")
|
| 80 |
+
RESERVED_EMAIL_DOMAIN = "example.test"
|
| 81 |
|
| 82 |
|
| 83 |
def _gold_files() -> list[Path]:
|
|
|
|
| 131 |
|
| 132 |
assert found_emails, "Expected at least one synthetic email fixture in corpus/"
|
| 133 |
for email in found_emails:
|
| 134 |
+
_, domain = email.rsplit("@", 1)
|
| 135 |
+
assert domain == RESERVED_EMAIL_DOMAIN, f"Use @{RESERVED_EMAIL_DOMAIN} only, got {email}"
|
| 136 |
|
| 137 |
|
| 138 |
def test_role_and_context_terms_are_preserved_not_sensitive_labels():
|