def crt_update(main_domains: Set[str]): found = set() lookup_domains = hosts_tools.reduce_domains(main_domains) for index, domain in enumerate(lookup_domains): if QUIT_GRACEFULLY: break print('Searching: %s' % domain) found_domains = hosts_tools.find_subdomains(domain) found.update(found_domains) print(' Found: %s' % (len(found_domains) - 1)) print_progress(index, len(lookup_domains)) return found
def test_find_subdomains(self): hosts_tools.safe_api_call = MagicMock(return_value=self.CRT_RESPONSE) found = hosts_tools.find_subdomains('example.com', True) assert found == {'example.com', 'www.example.com'}