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

add test for handling empty stream

parent 99eeb2f4
No related branches found
Tags 1.0.6
2 merge requests!146Release CMO metadata to production,!136return desired channels when no channels are found
......@@ -2,8 +2,9 @@ from typing import List
from obspy import Stream
from geomagio import DerivedTimeseriesFactory, TimeseriesUtility
from geomagio import TimeseriesUtility
from geomagio.algorithm import Algorithm, DeltaFAlgorithm, XYZAlgorithm
from geomagio.DerivedTimeseriesFactory import DerivedTimeseriesFactory, get_missing
from geomagio.iaga2002 import StreamIAGA2002Factory
from geomagio.edge import EdgeFactory
......@@ -91,6 +92,17 @@ def test_get_timeseries():
assert set(TimeseriesUtility.get_channels(timeseries)) == set(["H", "D"])
def test_get_missing():
"""test.DerivedTimeseriesFactory_test.test_get_missing()"""
desired = ["X", "Y", "D", "G"]
assert set(get_missing(input=Stream(), desired=desired)) == set(desired)
desired = ["H", "E", "Z", "F"]
timeseries = get_derived_timeseries(
"etc/filter/BOU20200101vsec.sec", desired, "variation", "second"
)
assert get_missing(input=timeseries, desired=desired) == []
def get_derived_timeseries(
url: str, channels: List[str], data_type: str, interval: str
) -> Stream:
......
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