Beispiel #1
0
def test_interpolation_type_mapping(client: Client, suffix_source):
    many_series = list(client.search(SeriesSelector(
        suffix_source("sql-list"))))
    interpolation_types = [(metadata.series.name, metadata.interpolation_type)
                           for metadata in many_series]
    assert ("test-tag-1", InterpolationType.LINEAR) in interpolation_types
    assert ("test-tag-4", InterpolationType.STEPPED) in interpolation_types
Beispiel #2
0
def test_search(client: Client):
    many_series = list(client.search(SeriesSelector(suffix_source("noaa"))))
    assert len(many_series) == 16
    series = [
        series for series in many_series
        if series.series.name == "h2o_feet,location=coyote_creek::water_level"
    ][0]
    assert series.limit_low == 6
    assert series.limit_high == 9
Beispiel #3
0
def test_search(client: Client):
    many_series = list(client.search(SeriesSelector("row")))
    assert len(many_series) == 5
    dictionary_series = [
        series for series in many_series if series.series.name == "test-tag-6"
    ][0]
    assert dictionary_series.description == "Valve X"
    assert dictionary_series.dictionary_name == "Active"
    assert dictionary_series.dictionary is not None
    assert len(dictionary_series.dictionary.mapping) == 2
    assert dictionary_series.dictionary.mapping[0] == "OFF"
    assert dictionary_series.dictionary.mapping[1] == "ON"
Beispiel #4
0
def test_search(client: Client, suffix_source):
    many_series = list(client.search(SeriesSelector(
        suffix_source("sql-list"))))
    assert len(many_series) == 4
    dictionary_series = [
        series for series in many_series if series.series.name == "test-tag-6"
    ][0]
    assert dictionary_series.description == "A dictionary series"
    assert dictionary_series.interpolation_type == InterpolationType.STEPPED
    assert dictionary_series.dictionary_name == "Active"
    assert dictionary_series.dictionary is not None
    assert len(dictionary_series.dictionary.mapping) == 2
    assert dictionary_series.dictionary.mapping[0] == "OFF"
    assert dictionary_series.dictionary.mapping[1] == "ON"