Mercurial > hg > orthanc-tests
comparison Tests/Tests.py @ 264:445f498bc1d4
test_upload_compressed
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 25 Feb 2020 11:07:37 +0100 |
parents | a2719263fd04 |
children | 8d63d035b837 |
comparison
equal
deleted
inserted
replaced
263:a2719263fd04 | 264:445f498bc1d4 |
---|---|
4897 | 4897 |
4898 self.assertRaises(Exception, lambda: DoPut(_REMOTE, '/tools/log-level', 'nope')) | 4898 self.assertRaises(Exception, lambda: DoPut(_REMOTE, '/tools/log-level', 'nope')) |
4899 | 4899 |
4900 # Switch back to the original log level | 4900 # Switch back to the original log level |
4901 DoPut(_REMOTE, '/tools/log-level', original) | 4901 DoPut(_REMOTE, '/tools/log-level', original) |
4902 | |
4903 | |
4904 def test_upload_compressed(self): | |
4905 with open(GetDatabasePath('DummyCT.dcm.gz'), 'rb') as f: | |
4906 d = f.read() | |
4907 | |
4908 self.assertRaises(Exception, lambda: DoPost(_REMOTE, '/instances', d, 'application/dicom')) | |
4909 | |
4910 self.assertRaises(Exception, lambda: DoPost(_REMOTE, '/instances', d, 'application/dicom', | |
4911 headers = { 'Content-Encoding' : 'nope' })) | |
4912 | |
4913 a = DoPost(_REMOTE, '/instances', d, 'application/dicom', | |
4914 headers = { 'Content-Encoding' : 'gzip' }) | |
4915 self.assertEqual('66a662ce-7430e543-bad44d47-0dc5a943-ec7a538d', a['ID']) | |
4902 | 4916 |
4903 | 4917 |
4904 def test_study_series_find_inconsistency(self): | 4918 def test_study_series_find_inconsistency(self): |
4905 # https://groups.google.com/forum/#!topic/orthanc-users/bLv6Z11COy0 | 4919 # https://groups.google.com/forum/#!topic/orthanc-users/bLv6Z11COy0 |
4906 | 4920 |