Mercurial > hg > orthanc-tests
diff Plugins/DicomWeb/Run.py @ 239:8980bd19e31d
dicomweb: test_allowed_methods
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 11 Jun 2019 21:38:06 +0200 |
parents | a4804d3f7499 |
children | adc6372b8820 |
line wrap: on
line diff
--- a/Plugins/DicomWeb/Run.py Wed May 29 17:49:02 2019 +0200 +++ b/Plugins/DicomWeb/Run.py Tue Jun 11 21:38:06 2019 +0200 @@ -641,6 +641,21 @@ self.assertEqual('SQ', a['00081199']['vr']) self.assertEqual(1, len(['00081199'])) + + def test_allowed_methods(self): + self.assertEqual(0, len(DoGet(ORTHANC, '/dicom-web/studies'))) + + with self.assertRaises(Exception) as e: + DoPut(ORTHANC, '/dicom-web/studies') + + self.assertEqual(405, e.exception[0]) + self.assertEqual("GET,POST", e.exception[1]['allow']) + + with self.assertRaises(Exception) as e: + DoDelete(ORTHANC, '/dicom-web/studies') + + self.assertEqual(405, e.exception[0]) + self.assertEqual("GET,POST", e.exception[1]['allow']) try: print('\nStarting the tests...')