diff Tests/Tests.py @ 354:88f076b906ca

test ArchiveSizeMB in archive jobs
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 03 Dec 2020 18:15:59 +0100
parents 49f2943544eb
children 95ee4e79825b
line wrap: on
line diff
--- a/Tests/Tests.py	Thu Dec 03 15:59:08 2020 +0100
+++ b/Tests/Tests.py	Thu Dec 03 18:15:59 2020 +0100
@@ -4201,6 +4201,11 @@
         self.assertEqual(1, len(z.namelist()))
         self.assertFalse('DICOMDIR' in z.namelist())
 
+        info = DoGet(_REMOTE, '/jobs/%s' % job)
+        self.assertEqual(0, info['Content']['ArchiveSizeMB'])  # New in Orthanc 1.8.1
+        self.assertEqual(1, info['Content']['InstancesCount'])
+        self.assertEqual(0, info['Content']['UncompressedSizeMB'])
+        
         job2 = MonitorJob2(_REMOTE, lambda: DoPost
                            (_REMOTE, '/studies/%s/media' % kneeT1, {
                                'Synchronous' : False
@@ -4214,6 +4219,11 @@
         self.assertEqual(2, len(z.namelist()))
         self.assertTrue('DICOMDIR' in z.namelist())
 
+        info = DoGet(_REMOTE, '/jobs/%s' % job2)
+        self.assertEqual(0, info['Content']['ArchiveSizeMB'])  # New in Orthanc 1.8.1
+        self.assertEqual(1, info['Content']['InstancesCount'])
+        self.assertEqual(0, info['Content']['UncompressedSizeMB'])
+
         job = MonitorJob2(_REMOTE, lambda: DoPost
                           (_REMOTE, '/tools/create-archive', {
                               'Synchronous' : False,
@@ -4224,6 +4234,11 @@
         self.assertEqual(2, len(z.namelist()))
         self.assertFalse('DICOMDIR' in z.namelist())
         
+        info = DoGet(_REMOTE, '/jobs/%s' % job)
+        self.assertEqual(0, info['Content']['ArchiveSizeMB'])  # New in Orthanc 1.8.1
+        self.assertEqual(2, info['Content']['InstancesCount'])
+        self.assertEqual(0, info['Content']['UncompressedSizeMB'])
+
         job = MonitorJob2(_REMOTE, lambda: DoPost
                           (_REMOTE, '/tools/create-media', {
                               'Synchronous' : False,
@@ -4234,6 +4249,10 @@
         self.assertEqual(3, len(z.namelist()))
         self.assertTrue('DICOMDIR' in z.namelist())
 
+        self.assertEqual(0, info['Content']['ArchiveSizeMB'])  # New in Orthanc 1.8.1
+        self.assertEqual(2, info['Content']['InstancesCount'])
+        self.assertEqual(0, info['Content']['UncompressedSizeMB'])
+        
         
     def test_queries_hierarchy(self):
         UploadInstance(_REMOTE, 'Knee/T1/IM-0001-0001.dcm')