コード例 #1
0
ファイル: test_stop.py プロジェクト: Robbe7730/realtime-gtfs
def test_equal():
    """
    test_equal: check if __eq__ functions
    """
    assert MINIMAL_STOP == MINIMAL_STOP
    assert MINIMAL_STOP != FULL_STOP
    assert FULL_STOP != MINIMAL_STOP
    assert FULL_STOP == FULL_STOP
    assert MINIMAL_STOP != "MINIMAL_STOP"

    temp_dict = MINIMAL_STOP_DICT.copy()
    temp_dict["platform_code"] = 2
    temp_stop = Stop.from_dict(temp_dict)

    assert temp_stop != MINIMAL_STOP
コード例 #2
0
ファイル: test_stop.py プロジェクト: Robbe7730/realtime-gtfs
    "stop_name": "Period",
    "stop_lat": "1.234",
    "stop_lon": "5.678",
    "stop_code": ".",
    "stop_desc": "A nice stop for taking a break",
    "stop_url": "https://period.com/",
    "location_type": "0",
    "stop_timezone": "Europe/Brussels",
    "wheelchair_boarding": "1",
    "platform_code": ".1",
    "zone_id": "123",
    "parent_station": "123",
    "level_id": "123"
}

MINIMAL_STOP = Stop.from_dict(MINIMAL_STOP_DICT)
FULL_STOP = Stop.from_dict(FULL_STOP_DICT)


def test_stop_happyflow_minimal():
    """
    test_stop_happyflow_minimal: minimal, correct example
    """
    stop = Stop.from_gtfs(MINIMAL_STOP_DICT.keys(), MINIMAL_STOP_DICT.values())
    assert stop == MINIMAL_STOP


def test_stop_happyflow_full():
    """
    test_stop_happyflow_full: full, correct example
    """