def test_delete_individual_complete_param(self): for complete in [True, False]: setup.clear_collection(self.ctrl_voc_endpoint) setup.clear_collection(self.property_endpoint) results = insert_two(self) for i, res in enumerate(results): res_delete = requests.delete( url=self.url + f"/id/{res.json()['id']}", params={"complete": complete}, ) if res_delete.status_code != 200: raise Exception( f"Deletion of {results[i].json()['id']} was not successful. " f"{res_delete.json()['id']}" ) res_deprecate = requests.get(url=self.url, params={"deprecated": True}) if complete: self.assertEqual(len(res_deprecate.json()), 0) else: self.assertEqual(len(res_deprecate.json()), 2) res = requests.get(url=self.url, params={"deprecated": False}) self.assertEqual(len(res.json()), 0)
def setUpClass(cls) -> None: super(PropertyGetTestCase, cls).setUpClass() cls.url = cls.property_endpoint setup.clear_collection(cls.ctrl_voc_endpoint) setup.clear_collection(cls.property_endpoint) cls.results = insert_two(cls)
def setUpClass(cls) -> None: super(PropertyGetTestCase, cls).setUpClass() cls.route = "properties" cls.url = urljoin(cls.host, cls.route) setup.clear_collection(cls.ctrl_voc_endpoint) setup.clear_collection(cls.property_endpoint) cls.results = insert_two(cls)
def test_delete(self): for complete in [True, False]: setup.clear_collection(self.ctrl_voc_endpoint) setup.clear_collection(self.property_endpoint) insert_two(self) res = requests.delete(url=self.url, params={"complete": complete}) res_delete = requests.get(url=self.url, params={"deprecated": True}) if complete: self.assertEqual(len(res_delete.json()), 0) else: self.assertEqual(len(res_delete.json()), 2) res = requests.get(url=self.url, params={"deprecated": False}) self.assertEqual(len(res.json()), 0)
def setUp(self) -> None: setup.clear_collection(self.user_endpoint)
def setUp(self) -> None: setup.clear_collection(self.ctrl_voc_endpoint) setup.clear_collection(self.property_endpoint)