changeset 572:3a5260cc6d55

new tests for DELETE jobs
author Alain Mazy <am@osimis.io>
date Thu, 20 Jul 2023 10:52:37 +0200
parents 42a6d327f59c
children 31ab8bb2ac5a
files .hgignore Tests/Tests.py
diffstat 2 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Thu Jun 29 15:32:30 2023 +0200
+++ b/.hgignore	Thu Jul 20 10:52:37 2023 +0200
@@ -10,3 +10,4 @@
 *~
 NewTests/storages/**
 NewTests/configurations/*.json
+.env/
\ No newline at end of file
--- a/Tests/Tests.py	Thu Jun 29 15:32:30 2023 +0200
+++ b/Tests/Tests.py	Thu Jul 20 10:52:37 2023 +0200
@@ -4815,7 +4815,25 @@
             DoDelete(_REMOTE, '/jobs/%s/archive' % job)
             # make sure it is not available anymore afterwards
             self.assertRaises(Exception, lambda: GetArchive(_REMOTE, '/jobs/%s/archive' % job))
-
+            # job is still available
+            DoGet(_REMOTE, '/jobs/%s' % job)
+
+            if IsOrthancVersionAbove(_REMOTE, 1, 12, 2):
+                # delete the job itself
+                DoDelete(_REMOTE, '/jobs/%s' % job)
+                self.assertRaises(Exception, lambda: DoGet(_REMOTE, '/jobs/%s' % job))
+
+                # test deletion of jobs in history
+                job = MonitorJob2(_REMOTE, lambda: DoPost
+                                (_REMOTE, '/series/%s/archive' % kneeT2, {
+                                    'Synchronous' : False
+                                }))
+                z = GetArchive(_REMOTE, '/jobs/%s/archive' % job)
+                # delete the job itself
+                DoDelete(_REMOTE, '/jobs/%s' % job)
+                # make sure it is not available anymore afterwards (and its output is not available either)
+                self.assertRaises(Exception, lambda: DoGet(_REMOTE, '/jobs/%s' % job))
+                self.assertRaises(Exception, lambda: GetArchive(_REMOTE, '/jobs/%s/archive' % job))
 
 
     def test_queries_hierarchy(self):