示例#1
0
文件: test.py 项目: laurentb/weboob
 def test_showtimelist(self):
     query = Query()
     query.city = u'59000'
     query.categories = [CATEGORIES.CINE]
     query.start_date = datetime.now()
     l = self.backend.search_events(query)
     assert len(l)
     e = l[0]
     self.backend.fillobj(e, 'description')
     self.assertTrue(e.description, 'Description of "%s" not found' % (e.id))
     e = self.backend.get_event(e.id)
     self.assertTrue(e.description, 'Description of "%s" not found' % (e.id))
示例#2
0
 def test_showtimelist(self):
     query = Query()
     query.city = u'59000'
     query.categories = [CATEGORIES.CINE]
     query.start_date = datetime.now()
     l = self.backend.search_events(query)
     assert len(l)
     e = l[0]
     self.backend.fillobj(e, 'description')
     self.assertTrue(e.description,
                     'Description of "%s" not found' % (e.id))
     e = self.backend.get_event(e.id)
     self.assertTrue(e.description,
                     'Description of "%s" not found' % (e.id))
示例#3
0
    def _fetch_objects(self, objs):
        objects = []
        collections = []
        split_path = self.working_path.get()
        try:
            if len(split_path) == 0:
                for category in CATEGORIES.values:
                    collection = Collection([category], category)
                    collection.backend = u'boobcoming'
                    collections.append(collection)
            elif len(split_path) == 1 and split_path[0] in CATEGORIES.values:
                query = Query()
                query.categories = split_path
                query.start_date = datetime.combine(parse_date('today'), time.min)
                query.end_date = parse_date('')
                query.city = ''
                for backend, event in self.do('search_events', query):
                    if event:
                        objects.append(event)
        except CallErrors as errors:
            self.bcall_errors_handler(errors, CollectionNotFound)

        return (objects, collections)
示例#4
0
 def test_sueurdemetal_nocategory(self):
     q = Query()
     q.categories = [CATEGORIES.CINE]
     self.assertTrue(len(list(self.backend.search_events(q))) == 0)