Esempio n. 1
0
def is_pure_tc_bss_test():
    resp_builder = ResponseBuilder().journey(sections=[
        {'mode': 'Walking'}, {'type': 'BSS_RENT'}, {'mode': 'Bike'}, {'type': 'BSS_PUT_BACK'},
        {'type': 'PT'},
        {'mode': 'Walking'},
    ])
    assert not destineo.is_pure_tc(resp_builder.response.journeys[0])
Esempio n. 2
0
def is_pure_tc_simple_test():
    resp_builder = ResponseBuilder().journey(sections=[{
        'mode': 'Walking'
    }, {
        'type': 'PT'
    }, {
        'mode': 'Walking'
    }])
    assert destineo.is_pure_tc(resp_builder.response.journeys[0])
Esempio n. 3
0
def is_pure_tc_crowfly_test():
    resp_builder = ResponseBuilder().journey(sections=[
        {
            'type': 'CROW_FLY',
            'mode': 'Walking'
        },
        {
            'type': 'PT'
        },
        {
            'mode': 'Walking'
        },
    ])
    assert destineo.is_pure_tc(resp_builder.response.journeys[0])
Esempio n. 4
0
def is_pure_tc_crowfly_test():
    response = response_pb2.Response()
    journey = response.journeys.add()

    journey.type = "best"
    section = journey.sections.add()
    section.type = response_pb2.CROW_FLY
    section.street_network.mode = response_pb2.Walking
    section = journey.sections.add()
    section.type = response_pb2.PUBLIC_TRANSPORT
    section = journey.sections.add()
    section.type = response_pb2.STREET_NETWORK
    section.street_network.mode = response_pb2.Walking

    assert destineo.is_pure_tc(journey)
Esempio n. 5
0
def is_pure_tc_bss_test():
    response = response_pb2.Response()
    journey = response.journeys.add()

    journey.type = "best"
    section = journey.sections.add()
    section.type = response_pb2.STREET_NETWORK
    section.street_network.mode = response_pb2.Walking
    section = journey.sections.add()
    section.type = response_pb2.BSS_RENT
    section = journey.sections.add()
    section.type = response_pb2.STREET_NETWORK
    section.street_network.mode = response_pb2.Bike
    section = journey.sections.add()
    section.type = response_pb2.BSS_PUT_BACK
    section = journey.sections.add()
    section.type = response_pb2.PUBLIC_TRANSPORT
    section = journey.sections.add()
    section.type = response_pb2.STREET_NETWORK
    section.street_network.mode = response_pb2.Walking

    assert not destineo.is_pure_tc(journey)