def list(self): events: List[EventV2] = self._client.list(before_dt=self.app.pargs.before, after_dt=self.app.pargs.after, order=self.app.pargs.order, event_type=self.app.pargs.type, subtype=self.app.pargs.subtype, action=self.app.pargs.action, email_address=self.app.pargs.email, device_id=self.app.pargs.device_id, device_serial=self.app.pargs.serial_number, container_id=self.app.pargs.container_id, service_name=self.app.pargs.service_name, event_id=self.app.pargs.event_id) event_json = EventV2.Schema().dump(events, many=True) self.app.render(event_json, handler='json', indent=2, sort_keys=True)
def test_parse_null_user(self): e: EventV2 = EventV2.Schema().loads( load_testdata("tests/data/event_v2_null_user.json")) self.assertIsNone(e.user_principal.user)
def test_parse_more(self): e: List[EventV2] = EventV2.Schema().loads( load_testdata("tests/data/more_events_v2.json"), many=True) self.assertEqual(292, len(e))
def test_parse_many(self): e: List[EventV2] = EventV2.Schema().loads( load_testdata("tests/data/events_v2.json"), many=True) self._test_specific_event(e[0])
def test_parse_event(self): e: EventV2 = EventV2.Schema().loads( load_testdata("tests/data/event_v2.json")) self._test_specific_event(e)