Adjust unitests to be able to skip if run on github

This commit is contained in:
L1ghtn1ng
2021-08-22 02:12:08 +01:00
parent a10a412e76
commit aa5760f419
9 changed files with 63 additions and 0 deletions
+7
View File
@@ -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:
+7
View File
@@ -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:
+7
View File
@@ -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:
+6
View File
@@ -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):
+8
View File
@@ -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()}
+7
View File
@@ -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:
+7
View File
@@ -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
+7
View File
@@ -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:
+7
View File
@@ -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: