Skip to content
Snippets Groups Projects
Commit 5a24e2ba authored by Cain, Payton David's avatar Cain, Payton David
Browse files

remove conftest.py

parent 640a8f2d
No related branches found
No related tags found
2 merge requests!146Release CMO metadata to production,!138Locations as Data Types
import numpy
from obspy import Stream, UTCDateTime
from obspy.clients.neic.client import Client
import pytest
from geomagio import TimeseriesUtility
from geomagio.edge import SNCL
@pytest.fixture(scope="class")
def MockMiniSeedClient() -> Client:
"""replaces default obspy miniseed client's get_waveforms method to return trace of ones"""
class MockMiniSeedClient(Client):
def get_waveforms(
self,
network: str,
station: str,
location: str,
channel: str,
starttime: UTCDateTime,
endtime: UTCDateTime,
):
sncl = SNCL(
station=station,
network=network,
channel=channel,
location=location,
)
trace = TimeseriesUtility.create_empty_trace(
starttime=starttime,
endtime=endtime,
observatory=station,
channel=channel,
type=sncl.data_type,
interval=sncl.interval,
network=network,
station=station,
location=location,
)
trace.data = numpy.ones(trace.stats.npts)
return Stream([trace])
yield MockMiniSeedClient
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment