changeset 445:09ebdee8eda2

added test for /attachments/../info
author Alain Mazy <am@osimis.io>
date Wed, 09 Feb 2022 15:29:07 +0100
parents dbe74add9a21
children 9184e6cb215a
files README Tests/Run.py Tests/Tests.py
diffstat 3 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/README	Wed Feb 09 15:17:54 2022 +0100
+++ b/README	Wed Feb 09 15:29:07 2022 +0100
@@ -122,6 +122,10 @@
 
 # python ./Tests/Run.py
 
+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
+
+
 Use the flag "--help" to get the full list of arguments. These
 arguments will notably allow you to specify the network parameters
 of your remote instance of Orthanc.
@@ -144,7 +148,7 @@
 may specify them when starting the test as shown below
 
 # bash
-# python Tests/Run.py --force --dicom 8567 --rest 8568
+# python2 Tests/Run.py --force --dicom 4242 --rest 8042 --orthanc /home/alain/Releases/Orthanc-0.8.6/Build/Orthanc Orthanc.test_peer_store_straight
 
 Note that you will have to install Linux prerequisites under WSL
 and the orthanc package as well.
--- a/Tests/Run.py	Wed Feb 09 15:17:54 2022 +0100
+++ b/Tests/Run.py	Wed Feb 09 15:29:07 2022 +0100
@@ -126,6 +126,8 @@
 ])
 
 
+print "toto"
+
 LOCAL = DefineOrthanc(aet = 'ORTHANCTEST',
                       server = 'localhost',
                       dicomPort = 5001,
--- a/Tests/Tests.py	Wed Feb 09 15:17:54 2022 +0100
+++ b/Tests/Tests.py	Wed Feb 09 15:29:07 2022 +0100
@@ -244,7 +244,14 @@
         else:
             self.assertRaises(Exception, lambda: DoGet(_REMOTE, '/instances/%s/attachments/dicom-until-pixel-data' % instance))
             j = int(DoGet(_REMOTE, '/instances/%s/attachments/dicom-as-json/size' % instance))
-            
+
+        if IsOrthancVersionAbove(_REMOTE, 1, 10, 0):
+            attachmentInfo = DoGet(_REMOTE, '/instances/%s/attachments/dicom/info' % instance)
+            self.assertEqual(sizeDummyCT, attachmentInfo['CompressedSize'])
+            self.assertEqual(sizeDummyCT, attachmentInfo['UncompressedSize'])
+            self.assertIn('Uuid', attachmentInfo)
+            self.assertEqual(1, attachmentInfo['ContentType'])
+
         s = sizeDummyCT + j
 
         if isCompressed: