Mercurial > hg > orthanc-tests
changeset 456:0d7c0bbe6c90 more-tags
fix
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 23 Mar 2022 09:24:07 +0100 |
parents | 6105b7671a58 |
children | ee398adfeb8e |
files | README Tests/Tests.py |
diffstat | 2 files changed, 26 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/README Tue Mar 15 15:57:52 2022 +0100 +++ b/README Wed Mar 23 09:24:07 2022 +0100 @@ -53,7 +53,7 @@ 2. In the second command shell: -# python ./Tests/Run.py +# python ./Plugins/Worklists/Run.py @@ -125,6 +125,8 @@ To run a single test with by fixing the Orthanc 0.8.6 executable path: # python2 ./Tests/Run.py --orthanc /home/alain/Releases/Orthanc-0.8.6/Build/Orthanc Orthanc.test_peer_store_straight +To run a plugin test (no need for Orthanc 0.8.6) +# python2 ./Plugins/DicomWeb/Run.py Orthanc.test_peer_store_straight Use the flag "--help" to get the full list of arguments. These arguments will notably allow you to specify the network parameters
--- a/Tests/Tests.py Tue Mar 15 15:57:52 2022 +0100 +++ b/Tests/Tests.py Wed Mar 23 09:24:07 2022 +0100 @@ -217,6 +217,14 @@ self.assertFalse(IsOrthancVersionAbove(_LOCAL, 0, 9, 6)) self.assertFalse(IsOrthancVersionAbove(_LOCAL, 1, 8, 6)) + system = DoGet(_REMOTE, '/system') + self.assertIn("MainDicomTags", system) + self.assertIn("Patient", system["MainDicomTags"]) + self.assertIn("Studies", system["MainDicomTags"]) + self.assertIn("Series", system["MainDicomTags"]) + self.assertIn("Instance", system["MainDicomTags"]) + + def test_upload(self): self.assertEqual('0', DoGet(_REMOTE, '/statistics')['TotalDiskSize']) self.assertEqual('0', DoGet(_REMOTE, '/statistics')['TotalUncompressedSize']) @@ -8564,6 +8572,19 @@ self.assertEqual('2.16.840.1.113669.632.20.1211.10000357775', a[0]['RequestedTags']['StudyInstanceUID']) self.assertEqual('2', a[0]['RequestedTags']['NumberOfSeriesRelatedInstances']) + # Instance level + a = DoPost(_REMOTE, '/tools/find', { 'Level' : 'Instance', + 'CaseSensitive' : False, + 'Query' : { 'PatientName' : 'BRAINIX' }, + 'RequestedTags' : [ 'PatientName', 'StudyInstanceUID', 'SOPInstanceUID', 'InstanceAvailability'], + 'Expand': True + }) + self.assertEqual(2, len(a)) + + self.assertEqual('BRAINIX', a[0]['RequestedTags']['PatientName']) + self.assertEqual('2.16.840.1.113669.632.20.1211.10000357775', a[0]['RequestedTags']['StudyInstanceUID']) + self.assertEqual('ONLINE', a[0]['RequestedTags']['InstanceAvailability']) + def test_list_resources_requested_tags(self): instance = UploadInstance(_REMOTE, 'DummyCT.dcm') ['ID'] @@ -8586,7 +8607,7 @@ # list instances and request patient, studies and series tags including tags that are not in main dicom tags - a = DoGet(_REMOTE, '/patients/%s/instances?expand&simplify&requestedTags=PatientName;StudyInstanceUID;SeriesInstanceUID;SOPInstanceUID;Rows;Columns' % patient) + a = DoGet(_REMOTE, '/patients/%s/instances?expand&simplify&requestedTags=PatientName;StudyInstanceUID;SeriesInstanceUID;SOPInstanceUID;Rows;Columns;InstanceAvailability' % patient) self.assertEqual('1.2.840.113619.2.176.2025.1499492.7391.1171285944.390', a[0]['RequestedTags']['StudyInstanceUID']) self.assertEqual('1.2.840.113619.2.176.2025.1499492.7391.1171285944.394', a[0]['RequestedTags']['SeriesInstanceUID']) @@ -8594,6 +8615,7 @@ self.assertEqual('KNIX', a[0]['RequestedTags']['PatientName']) self.assertEqual('512', a[0]['RequestedTags']['Rows']) self.assertEqual('512', a[0]['RequestedTags']['Columns']) + self.assertEqual('ONLINE', a[0]['RequestedTags']['Availability']) def test_list_resources_requested_tags_study_computed_tags(self):