Example #1
0
 def test_roadmap_arrival(self):
     filters = RoadmapFilters()
     filters.arrival_time = datetime.datetime.now() + datetime.timedelta(
         days=1)
     roadmap = list(
         self.backend.iter_roadmap('Chartres', 'Ballan-Miré', filters))
     self.assertTrue(len(roadmap) > 0)
Example #2
0
    def do_roadmap(self, line):
        """
        roadmap DEPARTURE ARRIVAL

        Display the roadmap to travel from DEPARTURE to ARRIVAL.

        Command-line parameters:
           --departure-time TIME    requested departure time
           --arrival-time TIME      requested arrival time

        TIME might be in form "yyyy-mm-dd HH:MM" or "HH:MM".

        Example:
            > roadmap Puteaux Aulnay-sous-Bois --arrival-time 22:00
        """
        departure, arrival = self.parse_command_args(line, 2, 2)

        filters = RoadmapFilters()
        try:
            filters.departure_time = self.parse_datetime(self.options.departure_time)
            filters.arrival_time = self.parse_datetime(self.options.arrival_time)
        except ValueError as e:
            print('Invalid datetime value: %s' % e, file=self.stderr)
            print('Please enter a datetime in form "yyyy-mm-dd HH:MM" or "HH:MM".', file=self.stderr)
            return 1

        for route in self.do('iter_roadmap', departure, arrival, filters):
            self.format(route)
Example #3
0
    def do_roadmap(self, line):
        """
        roadmap DEPARTURE ARRIVAL

        Display the roadmap to travel from DEPARTURE to ARRIVAL.

        Command-line parameters:
           --departure-time TIME    requested departure time
           --arrival-time TIME      requested arrival time

        TIME might be in form "yyyy-mm-dd HH:MM" or "HH:MM".

        Example:
            > roadmap Puteaux Aulnay-sous-Bois --arrival-time 22:00
        """
        departure, arrival = self.parse_command_args(line, 2, 2)

        filters = RoadmapFilters()
        try:
            filters.departure_time = self.parse_datetime(self.options.departure_time)
            filters.arrival_time = self.parse_datetime(self.options.arrival_time)
        except ValueError as e:
            print('Invalid datetime value: %s' % e, file=self.stderr)
            print('Please enter a datetime in form "yyyy-mm-dd HH:MM" or "HH:MM".', file=self.stderr)
            return 1

        for route in self.do('iter_roadmap', departure, arrival, filters):
            self.format(route)
Example #4
0
    def test_roadmap(self):
        filters = RoadmapFilters()
        roadmap = list(self.backend.iter_roadmap('aul', u'aub', filters))
        self.assertTrue(len(roadmap) > 0)

        filters.arrival_time = datetime.datetime.now() + datetime.timedelta(days=1)
        roadmap = list(self.backend.iter_roadmap('aul', u'bag', filters))
        self.assertTrue(len(roadmap) > 0)
Example #5
0
    def test_roadmap(self):
        filters = RoadmapFilters()
        roadmap = list(self.backend.iter_roadmap('Puteaux', u'École Militaire', filters))
        self.assertTrue(len(roadmap) > 0)

        filters.arrival_time = datetime.datetime.now() + datetime.timedelta(days=1)
        roadmap = list(self.backend.iter_roadmap('Puteaux', u'Aulnay-sous-Bois', filters))
        self.assertTrue(len(roadmap) > 0)
Example #6
0
    def test_roadmap(self):
        filters = RoadmapFilters()
        roadmap = list(self.backend.iter_roadmap('aul', u'aub', filters))
        self.assertTrue(len(roadmap) > 0)

        filters.arrival_time = datetime.datetime.now() + datetime.timedelta(
            days=1)
        roadmap = list(self.backend.iter_roadmap('aul', u'bag', filters))
        self.assertTrue(len(roadmap) > 0)
Example #7
0
    def test_roadmap(self):
        filters = RoadmapFilters()
        roadmap = list(
            self.backend.iter_roadmap('Puteaux', u'École Militaire', filters))
        self.assertTrue(len(roadmap) > 0)

        filters.arrival_time = datetime.datetime.now() + datetime.timedelta(
            days=1)
        roadmap = list(
            self.backend.iter_roadmap('Puteaux', u'Aulnay-sous-Bois', filters))
        self.assertTrue(len(roadmap) > 0)
Example #8
0
    def test_roadmap(self):
        filters = RoadmapFilters()
        roadmap = list(self.backend.iter_roadmap('aul', u'aub', filters))
        self.assertTrue(len(roadmap) > 0)

        filters.arrival_time = datetime.datetime.now() + datetime.timedelta(days=1)
        roadmap = list(self.backend.iter_roadmap('aul', u'bag', filters))
        self.assertTrue(len(roadmap) > 0)

        filters.departure_time = datetime.datetime.now() + datetime.timedelta(days=1)
        roadmap = list(self.backend.iter_roadmap('gare du nord', u'stade de boulogne', filters))
        self.assertTrue(len(roadmap) > 0)
Example #9
0
    def test_roadmap(self):
        filters = RoadmapFilters()
        roadmap = list(self.backend.iter_roadmap('aul', u'aub', filters))
        self.assertTrue(len(roadmap) > 0)

        filters.arrival_time = datetime.datetime.now() + datetime.timedelta(
            days=1)
        roadmap = list(self.backend.iter_roadmap('aul', u'bag', filters))
        self.assertTrue(len(roadmap) > 0)

        filters.departure_time = datetime.datetime.now() + datetime.timedelta(
            days=1)
        roadmap = list(
            self.backend.iter_roadmap('gare du nord', u'stade de boulogne',
                                      filters))
        self.assertTrue(len(roadmap) > 0)
Example #10
0
 def test_roadmap_arrival(self):
     filters = RoadmapFilters()
     filters.arrival_time = datetime.datetime.now() + datetime.timedelta(days=1)
     roadmap = list(self.backend.iter_roadmap('Chartres', 'Ballan-Miré', filters))
     self.assertTrue(len(roadmap) > 0)
Example #11
0
 def test_roadmap_long(self):
     filters = RoadmapFilters()
     roadmap = list(
         self.backend.iter_roadmap('Chartres', 'Ballan-Miré', filters))
     self.assertTrue(len(roadmap) > 0)
Example #12
0
 def test_roadmap_names(self):
     filters = RoadmapFilters()
     roadmap = list(
         self.backend.iter_roadmap('Artannes Mairie', 'Château de Blois',
                                   filters))
     self.assertTrue(len(roadmap) > 0)
Example #13
0
 def test_roadmap_stop_intracity2(self):
     filters = RoadmapFilters()
     roadmap = list(
         self.backend.iter_roadmap('J.P.Rameau', 'Polytech Tours', filters))
     self.assertTrue(len(roadmap) > 0)
Example #14
0
 def test_roadmap_stop_intracity(self):
     filters = RoadmapFilters()
     roadmap = list(
         self.backend.iter_roadmap('Tours Jean-Jaurès', 'Polytech Tours',
                                   filters))
     self.assertTrue(len(roadmap) > 0)
Example #15
0
 def test_roadmap_cities(self):
     filters = RoadmapFilters()
     roadmap = list(self.backend.iter_roadmap('Tours', 'Orléans', filters))
     self.assertTrue(len(roadmap) > 0)