Exemplo n.º 1
0
def test_equal():
    """
    test_equal: check if __eq__ functions
    """
    assert MINIMAL_PATHWAY == MINIMAL_PATHWAY
    assert MINIMAL_PATHWAY != FULL_PATHWAY
    assert FULL_PATHWAY != MINIMAL_PATHWAY
    assert FULL_PATHWAY == FULL_PATHWAY
    assert MINIMAL_PATHWAY != "MINIMAL_PATHWAY"

    temp_dict = MINIMAL_PATHWAY_DICT.copy()
    temp_dict["length"] = 2
    temp_pathway = Pathway.from_dict(temp_dict)

    assert temp_pathway != MINIMAL_PATHWAY
Exemplo n.º 2
0
FULL_PATHWAY_DICT = {
    "pathway_id": "123",
    "from_stop_id": "123",
    "to_stop_id": "123",
    "pathway_mode": "2",
    "is_bidirectional": "1",
    "length": "100",
    "traversal_time": "10",
    "stair_count": "97",
    "min_width": "0.5",
    "signposted_as": "This Way",
    "reversed_signposted_as": "Not This Way"
}

MINIMAL_PATHWAY = Pathway.from_dict(MINIMAL_PATHWAY_DICT)
FULL_PATHWAY = Pathway.from_dict(FULL_PATHWAY_DICT)


def test_pathway_happyflow_minimal():
    """
    test_pathway_happyflow_minimal: minimal, correct example
    """
    pathway = Pathway.from_gtfs(MINIMAL_PATHWAY_DICT.keys(),
                                MINIMAL_PATHWAY_DICT.values())
    assert pathway == MINIMAL_PATHWAY


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