Esempio n. 1
0
def test_level_series_input():
    value = [1000, 2000, 3000]
    vstring = ",".join([str(i) for i in value])

    for lev in (vstring, value, tuple(value)):

        level = level_series(lev)
        parameter = LevelParameter(level)
        assert parameter.type == "series"
        assert parameter.value == value
        assert parameter.asdict() == {"level_values": value}
Esempio n. 2
0
def test_slash_none():
    level = "/"
    parameter = LevelParameter(level)
    assert parameter.tuple == (None, None)
    assert parameter.asdict() == {"start": None, "end": None}
Esempio n. 3
0
def test_as_dict():
    level = "1000/2000"
    parameter = LevelParameter(level)
    assert parameter.asdict() == {"start": 1000, "end": 2000}
Esempio n. 4
0
def test_slash_none():
    level = level_interval("/")
    parameter = LevelParameter(level)
    assert parameter.value is None
    assert parameter.asdict() == {"first_level": None, "last_level": None}
Esempio n. 5
0
def test_as_dict():
    level = level_interval("1000/2000")
    parameter = LevelParameter(level)
    assert parameter.asdict() == {"first_level": 1000, "last_level": 2000}