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:
Chris Hill-Scott
2019-02-12 13:17:08 +00:00
parent 70ac96fed9
commit 978719cd20
2 changed files with 271 additions and 1012 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -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():