sherlock/tests/conftest.py

24 lines
887 B
Python
Raw Permalink Normal View History

2024-05-20 08:44:52 +00:00
import os
2024-05-20 20:30:08 +00:00
import json
import urllib
2024-05-20 08:44:52 +00:00
import pytest
2024-06-24 20:40:03 +00:00
from sherlock_project.sites import SitesInformation
2024-05-20 08:44:52 +00:00
@pytest.fixture()
def sites_obj():
2024-06-24 21:04:50 +00:00
sites_obj = SitesInformation(data_file_path=os.path.join(os.path.dirname(__file__), "../sherlock_project/resources/data.json"))
2024-05-20 08:44:52 +00:00
yield sites_obj
@pytest.fixture(scope="session")
def sites_info():
2024-06-24 21:04:50 +00:00
sites_obj = SitesInformation(data_file_path=os.path.join(os.path.dirname(__file__), "../sherlock_project/resources/data.json"))
2024-05-20 08:44:52 +00:00
sites_iterable = {site.name: site.information for site in sites_obj}
yield sites_iterable
2024-05-20 20:30:08 +00:00
@pytest.fixture(scope="session")
def remote_schema():
2024-06-24 21:04:50 +00:00
schema_url: str = 'https://raw.githubusercontent.com/sherlock-project/sherlock/master/sherlock_project/resources/data.schema.json'
2024-05-20 20:30:08 +00:00
with urllib.request.urlopen(schema_url) as remoteschema:
schemadat = json.load(remoteschema)
yield schemadat