mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-30 20:27:30 -04:00
Ensure domains are canonicalised
So, each domain owner only has one entry in the file (but can still have multiple domains).
This commit is contained in:
1269
app/domains.yml
1269
app/domains.yml
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
from collections import OrderedDict
|
||||
from collections import Counter, OrderedDict
|
||||
from csv import DictReader
|
||||
from io import StringIO
|
||||
from pathlib import Path
|
||||
@@ -415,6 +415,18 @@ def test_validate_government_domain_data():
|
||||
}
|
||||
|
||||
|
||||
def test_domain_data_is_canonicalized():
|
||||
for owner, count in Counter(
|
||||
AgreementInfo(domain).owner
|
||||
for domain in AgreementInfo.domains.keys()
|
||||
if AgreementInfo(domain).is_canonical
|
||||
).most_common():
|
||||
if count > 1:
|
||||
raise ValueError(
|
||||
'{} entries in domains.yml for {}'.format(count, owner)
|
||||
)
|
||||
|
||||
|
||||
def test_validate_email_domain_data():
|
||||
|
||||
for domain in GovernmentEmailDomain.domains.keys():
|
||||
|
||||
Reference in New Issue
Block a user