def test_query(self): api.reset_environment() ids, resp_code = api.person_add(copy.deepcopy(self.family1)) r, resp_code = api.person_get('first_name', 'Jeffrey') self.assertTrue(ids[1] in [p['id'] for p in r])
def test_remove_parents(self): api.reset_environment() ids, resp_code = api.person_add(copy.deepcopy(self.family1)) r, resp_code = api.remove_parents(ids[2], [ids[0]]) self.assertTrue(ids[0] not in [p['id'] for p in r])
def test_modify(self): api.reset_environment() ids, resp_code = api.person_add(copy.deepcopy(self.family1)) new_val = 'FirstNAME' r, resp_code = api.modify_person(ids[0], 'first_name', new_val) self.assertEqual(r['first_name'], new_val)
def test_cousins(self): api.reset_environment() ids, resp_code = api.person_add(copy.deepcopy(self.family2)) r, resp_code = api.person_cousins(ids[6]) self.assertEqual(sorted(ids[7:8]), sorted([p['id'] for p in r]))
def test_siblings(self): api.reset_environment() ids, resp_code = api.person_add(copy.deepcopy(self.family1)) r, resp_code = api.person_siblings(ids[3]) self.assertTrue(3 in [p['id'] for p in r])
def test_children(self): api.reset_environment() ids, resp_code = api.person_add(copy.deepcopy(self.family1)) r, resp_code = api.person_children(ids[0]) self.assertEqual(sorted([p['id'] for p in r]), ids[2:])
def test_parents2(self): api.reset_environment() ids, resp_code = api.person_add(copy.deepcopy(self.family1)) r, resp_code = api.person_parents(ids[3]) self.assertEqual(sorted([p['id'] for p in r]), [1,2])