def test_parse_events(self): request = parse_request(fixtures.request_event) events = request.findall("app")[0].findall("event") events = parse_events(events) self.assertEqual(len(events), 3) event = events[0] self.assertIsInstance(event, Event) self.assertEqual(event.eventtype, 9) self.assertEqual(event.eventresult, 1) self.assertEqual(event.errorcode, 0) self.assertEqual(event.extracode1, 0) self.assertEqual(event.download_time_ms, None) self.assertEqual(event.downloaded, None) self.assertEqual(event.total, None) self.assertEqual(event.update_check_time_ms, None) self.assertEqual(event.install_time_ms, None) self.assertEqual(event.source_url_index, None) self.assertEqual(event.state_cancelled, None) self.assertEqual(event.time_since_update_available_ms, None) self.assertEqual(event.time_since_download_start_ms, None) self.assertEqual(event.nextversion, None) self.assertEqual(event.previousversion, None)
def test_parse_events(self): request = parse_request(fixtures.request_event) events = request.findall('app')[0].findall('event') events = parse_events(events) self.assertEqual(len(events), 3) event = events[0] self.assertIsInstance(event, Event) self.assertEqual(event.eventtype, 9) self.assertEqual(event.eventresult, 1) self.assertEqual(event.errorcode, 0) self.assertEqual(event.extracode1, 0) self.assertEqual(event.download_time_ms, None) self.assertEqual(event.downloaded, None) self.assertEqual(event.total, None) self.assertEqual(event.update_check_time_ms, None) self.assertEqual(event.install_time_ms, None) self.assertEqual(event.source_url_index, None) self.assertEqual(event.state_cancelled, None) self.assertEqual(event.time_since_update_available_ms, None) self.assertEqual(event.time_since_download_start_ms, None) self.assertEqual(event.nextversion, None) self.assertEqual(event.previousversion, None)