comparison 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
comparison
equal deleted inserted replaced
336:c8c76810c5bd 337:ec13ace43bde
30 import threading 30 import threading
31 import sys 31 import sys
32 import time 32 import time
33 import zipfile 33 import zipfile
34 34
35 from xml.dom import minidom
36
35 from PIL import Image, ImageChops 37 from PIL import Image, ImageChops
36 import math 38 import math
37 import operator 39 import operator
38 40
39 41
426 return max([ _GetMaxImageDifference(red1, red2), 428 return max([ _GetMaxImageDifference(red1, red2),
427 _GetMaxImageDifference(green1, green2), 429 _GetMaxImageDifference(green1, green2),
428 _GetMaxImageDifference(blue1, blue2) ]) 430 _GetMaxImageDifference(blue1, blue2) ])
429 else: 431 else:
430 return _GetMaxImageDifference(im1, im2) 432 return _GetMaxImageDifference(im1, im2)
433
434
435 def DoPropFind(orthanc, uri, depth):
436 http = httplib2.Http()
437 http.follow_redirects = False
438 _SetupCredentials(orthanc, http)
439
440 resp, content = http.request(orthanc['Url'] + uri, 'PROPFIND', headers = { 'Depth' : str(depth) })
441
442 if not (resp.status in [ 207 ]):
443 raise Exception(resp.status, resp)
444 else:
445 return minidom.parseString(content)
446