Mercurial > hg > orthanc-tests
comparison Tests/Toolbox.py @ 291:cfa785074c64
test_modify_transcode
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 07 May 2020 15:33:40 +0200 |
parents | 943166deebcb |
children | b8399213b840 |
comparison
equal
deleted
inserted
replaced
290:b5333f87065b | 291:cfa785074c64 |
---|---|
24 import json | 24 import json |
25 import os | 25 import os |
26 import re | 26 import re |
27 import signal | 27 import signal |
28 import subprocess | 28 import subprocess |
29 import tempfile | |
29 import threading | 30 import threading |
30 import sys | 31 import sys |
31 import time | 32 import time |
32 import zipfile | 33 import zipfile |
33 | 34 |
377 for i in range(len(a)): | 378 for i in range(len(a)): |
378 AssertAlmostEqualRecursive(self, a[i], b[i], places) | 379 AssertAlmostEqualRecursive(self, a[i], b[i], places) |
379 | 380 |
380 else: | 381 else: |
381 self.assertAlmostEqual(a, b, places = places) | 382 self.assertAlmostEqual(a, b, places = places) |
383 | |
384 | |
385 def GetTransferSyntax(dicom): | |
386 with tempfile.NamedTemporaryFile(delete = True) as f: | |
387 f.write(dicom) | |
388 f.flush() | |
389 data = subprocess.check_output([ FindExecutable('dcm2xml'), f.name ]) | |
390 | |
391 return re.search('<data-set xfer="(.*?)"', data).group(1) |