mirror of
https://github.com/laramies/theHarvester.git
synced 2026-09-29 21:14:56 +02:00
Adjust unitests to be able to skip if run on github
This commit is contained in:
@@ -3,11 +3,18 @@
|
||||
import requests
|
||||
from theHarvester.lib.core import *
|
||||
from theHarvester.discovery import anubis
|
||||
import os
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def is_github_action():
|
||||
if os.getenv('GITHUB_ACTIONS'):
|
||||
return 'github'
|
||||
|
||||
|
||||
class TestAnubis:
|
||||
@staticmethod
|
||||
def domain() -> str:
|
||||
|
||||
@@ -2,12 +2,19 @@
|
||||
# coding=utf-8
|
||||
from theHarvester.lib.core import *
|
||||
from theHarvester.discovery import bufferoverun
|
||||
import os
|
||||
import requests
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def is_github_action():
|
||||
if os.getenv('GITHUB_ACTIONS'):
|
||||
return 'github'
|
||||
|
||||
|
||||
class TestBufferover(object):
|
||||
@staticmethod
|
||||
def domain() -> str:
|
||||
|
||||
@@ -2,12 +2,19 @@
|
||||
# coding=utf-8
|
||||
from theHarvester.lib.core import *
|
||||
from theHarvester.discovery import certspottersearch
|
||||
import os
|
||||
import requests
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def is_github_action():
|
||||
if os.getenv('GITHUB_ACTIONS'):
|
||||
return 'github'
|
||||
|
||||
|
||||
class TestCertspotter(object):
|
||||
@staticmethod
|
||||
def domain() -> str:
|
||||
|
||||
@@ -9,6 +9,12 @@ import pytest
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def is_github_action():
|
||||
if os.getenv('GITHUB_ACTIONS'):
|
||||
return 'github'
|
||||
|
||||
|
||||
class TestGetLinks(object):
|
||||
|
||||
async def test_splitter(self):
|
||||
|
||||
@@ -2,17 +2,25 @@
|
||||
# coding=utf-8
|
||||
from theHarvester.lib.core import *
|
||||
from theHarvester.discovery import omnisint
|
||||
import os
|
||||
import requests
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def is_github_action():
|
||||
if os.getenv('GITHUB_ACTIONS'):
|
||||
return 'github'
|
||||
|
||||
|
||||
class TestOmnisint(object):
|
||||
@staticmethod
|
||||
def domain() -> str:
|
||||
return 'uber.com'
|
||||
|
||||
@pytest.mark.skipif(is_github_action == 'github', reason='Skipped test as fails on CI often but not locally')
|
||||
async def test_api(self):
|
||||
base_url = f'https://sonar.omnisint.io/all/{TestOmnisint.domain()}'
|
||||
headers = {'User-Agent': Core.get_user_agent()}
|
||||
|
||||
@@ -2,12 +2,19 @@
|
||||
# coding=utf-8
|
||||
from theHarvester.lib.core import *
|
||||
from theHarvester.discovery import otxsearch
|
||||
import os
|
||||
import requests
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def is_github_action():
|
||||
if os.getenv('GITHUB_ACTIONS'):
|
||||
return 'github'
|
||||
|
||||
|
||||
class TestOtx(object):
|
||||
@staticmethod
|
||||
def domain() -> str:
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
# coding=utf-8
|
||||
from theHarvester.discovery import qwantsearch
|
||||
import os
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def is_github_action():
|
||||
if os.getenv('GITHUB_ACTIONS'):
|
||||
return 'github'
|
||||
|
||||
|
||||
class TestSearchQwant(object):
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -3,11 +3,18 @@
|
||||
import requests
|
||||
from theHarvester.lib.core import *
|
||||
from theHarvester.discovery import sublist3r
|
||||
import os
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def is_github_action():
|
||||
if os.getenv('GITHUB_ACTIONS'):
|
||||
return 'github'
|
||||
|
||||
|
||||
class TestSublist3r(object):
|
||||
@staticmethod
|
||||
def domain() -> str:
|
||||
|
||||
@@ -3,11 +3,18 @@
|
||||
import requests
|
||||
from theHarvester.lib.core import *
|
||||
from theHarvester.discovery import threatminer
|
||||
import os
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def is_github_action():
|
||||
if os.getenv('GITHUB_ACTIONS'):
|
||||
return 'github'
|
||||
|
||||
|
||||
class TestThreatminer(object):
|
||||
@staticmethod
|
||||
def domain() -> str:
|
||||
|
||||
Reference in New Issue
Block a user