diff Tests/Tests.py @ 231:4087505ddfe3

catching error codes of movescu
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 05 Mar 2019 07:02:26 +0100
parents 7b1c976caa9b
children ce0b19a2c807
line wrap: on
line diff
--- a/Tests/Tests.py	Fri Mar 01 16:39:53 2019 +0100
+++ b/Tests/Tests.py	Tue Mar 05 07:02:26 2019 +0100
@@ -102,10 +102,19 @@
         str(_REMOTE['DicomPort'])  
         ]
 
+
 def CallMoveScu(args):
-    subprocess.check_call(GetMoveScuCommand() + args,
-                          stderr=subprocess.PIPE)
-
+    try:
+        subprocess.check_call(GetMoveScuCommand() + args,
+                              stderr=subprocess.PIPE)
+    except subprocess.CalledProcessError as e:
+        # The error code "69" corresponds to "EXITCODE_CMOVE_ERROR",
+        # that has been introduced in DCMTK 3.6.2. This error code is
+        # expected by some tests that try and C-MOVE non-existing
+        # DICOM instances.
+        # https://groups.google.com/d/msg/orthanc-users/DCRc5NeSCbM/DG-pSWj-BwAJ
+        if e.returncode != 69:
+            raise e
 
 
 def GenerateTestSequence():