Exemplo n.º 1
0
def test_typical_range_consistent():
    # Create a station
    s_id = "test-s-id"
    m_id = "test-m-id"
    label = "some station"
    coord = (-2.0, 4.0)
    trange = (3.44, 2.5)
    river = "River X"
    town = "My Town"
    s = MonitoringStation(s_id, m_id, label, coord, trange, river, town)
    assert MonitoringStation.typical_range_consistent(s) == False
                                                     
Exemplo n.º 2
0
def test_inconsistent_monitoring_station_data():

    #Create a station with inconsistent typical range data
    s_id = "test-s-id"
    m_id = "test-m-id"
    label = "some station"
    coord = (-2.0, 4.0)
    trange = 'some inconsistent data'
    river = "River X"
    town = "My Town"
    dateOpened = "some date"
    s = MonitoringStation(s_id, m_id, label, coord, trange, river, town,
                          dateOpened)

    assert s.typical_range_consistent() == False
def test_create_monitoring_station():

    # Create a station
    s_id = "test-s-id"
    m_id = "test-m-id"
    label = "some station"
    coord = (-2.0, 4.0)
    trange = (-2.3, 3.4445)
    river = "River X"
    town = "My Town"
    s = MonitoringStation(s_id, m_id, label, coord, trange, river, town)

    assert s.station_id == s_id
    assert s.measure_id == m_id
    assert s.name == label
    assert s.coord == coord
    assert s.typical_range == trange
    assert s.river == river
    assert s.town == town
    
    assert s.typical_range_consistent() == (s.typical_range[0] <= s.typical_range[1])
Exemplo n.º 4
0
def test_create_monitoring_station():

    # Create a station
    s_id = "test-s-id"
    m_id = "test-m-id"
    label = "some station"
    coord = (-2.0, 4.0)
    trange = (1, 3)
    river = "Cam"
    town = "My Town"

    s = MonitoringStation(s_id, m_id, label, coord, trange, river, town)
    s.latest_level = None

    assert s.station_id == s_id
    assert s.measure_id == m_id
    assert s.name == label
    assert s.coord == coord
    assert s.typical_range == trange
    assert s.river == river
    assert s.town == town
    assert s.typical_range_consistent() == False
    assert s.relative_water_level() == None