Code Repositories xandikos / ec244ce
Avoid fromisoformat, not available in Python < 3.7. Jelmer Vernooń≥ 3 months ago
1 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
272272 filter = CalendarFilter(self._tzify)
273273 filter.filter_subcomponent('VCALENDAR').filter_subcomponent(
274274 'VTODO').filter_property('CREATED').filter_time_range(
275 self._tzify(datetime.fromisoformat('2019-03-10 22:35:12')),
276 self._tzify(datetime.fromisoformat('2019-03-18 22:35:12')))
275 self._tzify(datetime(2019, 3, 10, 22, 35, 12)),
276 self._tzify(datetime(2019, 3, 18, 22, 35, 12)))
277277 self.assertEqual(
278278 filter.index_keys(),
279279 [['C=VCALENDAR/C=VTODO/P=CREATED']])
285285 filter = CalendarFilter(self._tzify)
286286 filter.filter_subcomponent('VCALENDAR').filter_subcomponent(
287287 'VTODO').filter_property('CREATED').filter_time_range(
288 self._tzify(datetime.fromisoformat('2015-03-10 22:35:12')),
289 self._tzify(datetime.fromisoformat('2015-03-18 22:35:12')))
288 self._tzify(datetime(2015, 3, 10, 22, 35, 12)),
289 self._tzify(datetime(2015, 3, 18, 22, 35, 12)))
290290 self.assertTrue(
291291 filter.check_from_indexes(
292292 'file',
297297 filter = CalendarFilter(self._tzify)
298298 filter.filter_subcomponent('VCALENDAR').filter_subcomponent(
299299 'VTODO').filter_time_range(
300 self._tzify(datetime.fromisoformat('2015-03-03 22:35:12')),
301 self._tzify(datetime.fromisoformat('2015-03-10 22:35:12')))
300 self._tzify(datetime(2015, 3, 3, 22, 35, 12)),
301 self._tzify(datetime(2015, 3, 10, 22, 35, 12)))
302302 self.assertEqual(
303303 filter.index_keys(),
304304 [['C=VCALENDAR/C=VTODO/P=DTSTART'],
321321 filter = CalendarFilter(self._tzify)
322322 filter.filter_subcomponent('VCALENDAR').filter_subcomponent(
323323 'VTODO').filter_time_range(
324 self._tzify(datetime.fromisoformat('2015-03-10 22:35:12')),
325 self._tzify(datetime.fromisoformat('2015-03-18 22:35:12')))
324 self._tzify(datetime(2015, 3, 10, 22, 35, 12)),
325 self._tzify(datetime(2015, 3, 18, 22, 35, 12)))
326326 self.assertTrue(
327327 filter.check_from_indexes(
328328 'file',