diff Tests/Toolbox.py @ 337:ec13ace43bde

trying webdav tests
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 10 Oct 2020 11:44:17 +0200
parents bac7cc80f240
children 66a36befb208
line wrap: on
line diff
--- a/Tests/Toolbox.py	Fri Sep 18 14:19:53 2020 +0200
+++ b/Tests/Toolbox.py	Sat Oct 10 11:44:17 2020 +0200
@@ -32,6 +32,8 @@
 import time
 import zipfile
 
+from xml.dom import minidom
+
 from PIL import Image, ImageChops
 import math
 import operator
@@ -428,3 +430,17 @@
                      _GetMaxImageDifference(blue1, blue2) ])
     else:
         return _GetMaxImageDifference(im1, im2)
+
+
+def DoPropFind(orthanc, uri, depth):
+    http = httplib2.Http()
+    http.follow_redirects = False
+    _SetupCredentials(orthanc, http)
+
+    resp, content = http.request(orthanc['Url'] + uri, 'PROPFIND', headers = { 'Depth' : str(depth) })
+
+    if not (resp.status in [ 207 ]):
+        raise Exception(resp.status, resp)
+    else:
+        return minidom.parseString(content)
+