# HG changeset patch # User Alain Mazy # Date 1719246733 -7200 # Node ID 2f6686a3cd1690797df8d03eb8522e13da8164bf # Parent 3ac37a99a09317cb19d3f5165ce75679cc64cdbe conditional test diff -r 3ac37a99a093 -r 2f6686a3cd16 NewTests/Authorization/test_authorization.py --- a/NewTests/Authorization/test_authorization.py Mon Jun 24 18:28:43 2024 +0200 +++ b/NewTests/Authorization/test_authorization.py Mon Jun 24 18:32:13 2024 +0200 @@ -265,29 +265,29 @@ def test_uploader_a(self): - o_admin = OrthancApiClient(self.o._root_url, headers={"user-token-key": "token-admin"}) o = OrthancApiClient(self.o._root_url, headers={"user-token-key": "token-uploader-a"}) - # # make sure we can access all these urls (they would throw if not) - system = o.get_system() - # time.sleep(10000) + if o_admin.is_plugin_version_at_least("authorization", 0, 7, 3): - all_labels = o.get_all_labels() - self.assertEqual(1, len(all_labels)) - self.assertEqual("label_a", all_labels[0]) + # # make sure we can access all these urls (they would throw if not) + system = o.get_system() + + all_labels = o.get_all_labels() + self.assertEqual(1, len(all_labels)) + self.assertEqual("label_a", all_labels[0]) - # make sure we can access only the label_a studies - self.assert_is_forbidden(lambda: o.studies.get_tags(self.label_b_study_id)) - self.assert_is_forbidden(lambda: o.studies.get_tags(self.no_label_study_id)) + # make sure we can access only the label_a studies + self.assert_is_forbidden(lambda: o.studies.get_tags(self.label_b_study_id)) + self.assert_is_forbidden(lambda: o.studies.get_tags(self.no_label_study_id)) - # uploader-a shall be able to upload a study - instances_ids = o.upload_file(here / "../../Database/Beaufix/IM-0001-0001.dcm") - o_admin.instances.delete(orthanc_ids=instances_ids) + # uploader-a shall be able to upload a study + instances_ids = o.upload_file(here / "../../Database/Beaufix/IM-0001-0001.dcm") + o_admin.instances.delete(orthanc_ids=instances_ids) - # uploader-a shall be able to upload a study through DICOMWeb too - o.upload_files_dicom_web(paths = [here / "../../Database/Beaufix/IM-0001-0001.dcm"]) - o_admin.instances.delete(orthanc_ids=instances_ids) + # uploader-a shall be able to upload a study through DICOMWeb too + o.upload_files_dicom_web(paths = [here / "../../Database/Beaufix/IM-0001-0001.dcm"]) + o_admin.instances.delete(orthanc_ids=instances_ids) def test_resource_token(self):