Fixed test in test_otx and fixed pep8 error in main.py

This commit is contained in:
NotoriousRebel 2019-09-25 15:17:24 -04:00
parent cdd6b9020c
commit 1286ba4b75
2 changed files with 4 additions and 5 deletions

View file

@ -20,7 +20,7 @@ def test_api(self):
def test_search(self):
search = otxsearch.SearchOtx(TestOtx.domain())
search.process()
assert type(search.get_hostnames()) == list
assert isinstance(search.get_hostnames(), set)
def test_search_no_results(self):
search = otxsearch.SearchOtx('radiant.eu')

View file

@ -435,11 +435,10 @@ def start():
else:
print('\n[*] IPs found: ' + str(len(all_ip)))
print('-------------------')
#ips = sorted(ipaddress.ip_address(line.strip()) for line in set(all_ip))
#print('\n'.join(map(str, ips)))
ip_list = [netaddr.IPAddress(ip.strip()) for ip in set(all_ip)]
# ips = sorted(ipaddress.ip_address(line.strip()) for line in set(all_ip))
# print('\n'.join(map(str, ips)))
ip_list = sorted([netaddr.IPAddress(ip.strip()) for ip in set(all_ip)])
# use netaddr as the list may contain ipv4 and ipv6 addresses
ip_list.sort()
print('\n'.join(map(str, ip_list)))
if len(all_emails) == 0: