def test_getthings_validations_and_intents(self): typeid = '40750a6a-89b2-455c-bd8d-b420a4cb500b' height_filter = ThingFilter() height_format = ThingFormat() height_format.sections.append('core') height_format.sections.append('xml') height_filter.typeids.append(typeid) group = ThingGroup() group.filters = [height_filter] method = GetThings([group]) with self.assertRaises(HealthServiceException): method.execute(self.connection) group.format = height_format group.intents = ThingIntentsSpec(['view', 'pingu']) method = GetThings([group]) with self.assertRaises(HealthServiceException): method.execute(self.connection) group.intents = ThingIntentsSpec(['view', 'download']) method = GetThings([group]) method.execute(self.connection) self.assertEqual(len(method.response.groups), 1) if method.response.groups[0].healthrecorditems: items = method.response.groups[0].healthrecorditems self.assertEqual(typeid, items[0].type_id)