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():
|
|
|
|
sites_obj = SitesInformation(data_file_path=os.path.join(os.path.dirname(__file__), "../sherlock/resources/data.json"))
|
|
|
|
yield sites_obj
|
|
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
|
|
def sites_info():
|
|
|
|
sites_obj = SitesInformation(data_file_path=os.path.join(os.path.dirname(__file__), "../sherlock/resources/data.json"))
|
|
|
|
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():
|
|
|
|
schema_url: str = 'https://raw.githubusercontent.com/sherlock-project/sherlock/master/sherlock/resources/data.schema.json'
|
|
|
|
with urllib.request.urlopen(schema_url) as remoteschema:
|
|
|
|
schemadat = json.load(remoteschema)
|
|
|
|
yield schemadat
|