theHarvester/tests/discovery/test_n45ht.py
J.Townsend 15fe11130c
Add new n45ht module, lots of results returned (#899)
* Add new fullhunt module

* Remove python checks in the run script as they are not needed anymore

* Remove netcraft from ci as it is not needed

* Update Dockerfile to fix security issues

* Add new n45ht module, lots of results returned
2021-10-24 04:10:37 +01:00

31 lines
915 B
Python

#!/usr/bin/env python3
# coding=utf-8
from theHarvester.lib.core import *
from theHarvester.discovery import n45htsearch
import os
import requests
import pytest
pytestmark = pytest.mark.asyncio
github_ci = os.getenv('GITHUB_ACTIONS') # Github set this to be the following: true instead of True
class TestN45ht(object):
@staticmethod
def domain() -> str:
return 'uber.com'
async def test_api(self):
base_url = f'https://api.n45ht.or.id/v1/subdomain-enumeration?domain={TestN45ht.domain()}'
headers = {'User-Agent': Core.get_user_agent()}
request = requests.get(base_url, headers=headers)
assert request.status_code == 200
async def test_do_search(self):
search = n45htsearch.SearchN45ht(TestN45ht.domain())
await search.process()
assert isinstance(await search.get_hostnames(), set)
if __name__ == '__main__':
pytest.main()