Example #1
0
def status_test():
    kraken = Kraken(instance=None, service_url=None, id=u"tata-é$~#@\"*!'`§èû", modes=["walking", "bike", "car"])

    status = kraken.status()
    assert len(status) == 3
    assert status['id'] == u'tata-é$~#@"*!\'`§èû'
    assert status['class'] == "Kraken"
    assert status['modes'] == ["walking", "bike", "car"]
Example #2
0
def test_feed_publisher():
    walking_service = Kraken(instance=None,
                             service_url='https://bob.com',
                             id=u"walking_service_id",
                             modes=["walking"])
    car_service = Here(instance=None,
                       service_base_url='https://bobobo.com',
                       id=u"car_service_id",
                       modes=["car"],
                       timeout=1)
    car_with_park = CarWithPark(instance=None,
                                walking_service=walking_service,
                                car_service=car_service)

    fp_car_service = car_service.feed_publisher()
    fp_car_with_park = car_with_park.feed_publisher()

    assert fp_car_service == fp_car_with_park
    assert fp_car_with_park.id == "here"
    assert fp_car_with_park.license == "Private"
    assert fp_car_with_park.name == "here"
    assert fp_car_with_park.url == "https://developer.here.com/terms-and-conditions"
Example #3
0
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Stay tuned using
# twitter @navitia
# IRC #navitia on freenode
# https://groups.google.com/d/forum/navitia
# www.navitia.io

from jormungandr.instance import Instance
from jormungandr.interfaces.v1 import add_common_status
from jormungandr.street_network.kraken import Kraken

from collections import OrderedDict

krakenBss = Kraken(instance=None,
                   service_url=None,
                   id="krakenBss",
                   modes=["bss"])
krakenAll = Kraken(instance=None,
                   service_url=None,
                   id="krakenAll",
                   modes=["walking", "bike", "car"])
expected_streetnetworks_status = [
    {
        'modes': ['walking', 'bike', 'car'],
        'id': 'krakenAll',
        'class': 'Kraken'
    },
    {
        'modes': ['bss'],
        'id': 'krakenBss',
        'class': 'Kraken'
 def get_street_network_routing_matrix(self, *args, **kwargs):
     self.routing_matrix_call_count += 1
     return Kraken.get_street_network_routing_matrix(self, *args, **kwargs)
 def _direct_path(self, *args, **kwargs):
     self.direct_path_call_count += 1
     return Kraken._direct_path(self, *args, **kwargs)