changeset 231:4087505ddfe3

catching error codes of movescu
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 05 Mar 2019 07:02:26 +0100
parents 7dc50b474bd4
children f2af7bdc9bf8
files Tests/Tests.py
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
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():