make test_validate_capitalizations slightly more bulletproof

This commit is contained in:
Jack O'Connor 2016-05-08 16:49:12 -04:00
parent 983e5bbc5f
commit f293ccc1f1
1 changed files with 4 additions and 0 deletions

View File

@ -404,6 +404,10 @@ class CacheTest(PeruTest):
@make_synchronous @make_synchronous
def test_validate_capitalizations(self): def test_validate_capitalizations(self):
# Assert that the set of capitalizations is the right size, both before
# and after deduplication.
self.assertEqual(len(peru.cache.DOTPERU_CAPITALIZATIONS), 16)
self.assertEqual(len(set(peru.cache.DOTPERU_CAPITALIZATIONS)), 16) self.assertEqual(len(set(peru.cache.DOTPERU_CAPITALIZATIONS)), 16)
# Check that every capitalization actually spells ".peru".
for capitalization in peru.cache.DOTPERU_CAPITALIZATIONS: for capitalization in peru.cache.DOTPERU_CAPITALIZATIONS:
self.assertEqual(capitalization.lower(), ".peru") self.assertEqual(capitalization.lower(), ".peru")