Mercurial > hg > orthanc-tests
diff Tests/Tests.py @ 519:b1991073e4d1
test alphanumeric labels
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 06 Apr 2023 17:01:27 +0200 |
parents | 43a323de0b02 |
children | 8114f67e0f7f |
line wrap: on
line diff
--- a/Tests/Tests.py Wed Apr 05 11:00:41 2023 +0200 +++ b/Tests/Tests.py Thu Apr 06 17:01:27 2023 +0200 @@ -9341,17 +9341,19 @@ for base in [ '/instances/%s' % u, '/series/%s' % series, '/studies/%s' % study, - '/series/%s' % series ]: + '/patients/%s' % patient ]: self.assertEqual(0, len(DoGet(_REMOTE, base) ['Labels'])) self.assertRaises(Exception, lambda: DoGet(_REMOTE, '%s/labels/hello' % base)) self.assertEqual('', DoDelete(_REMOTE, '%s/labels/hello' % base)) self.assertEqual(0, len(DoGet(_REMOTE, base) ['Labels'])) + self.assertRaises(Exception, lambda: DoPut(_REMOTE, '%s/labels/@' % base)) # Not an alphanumeric label self.assertEqual('', DoPut(_REMOTE, '%s/labels/hello' % base)) self.assertEqual('', DoPut(_REMOTE, '%s/labels/hello' % base)) # Ignore double tagging self.assertEqual('', DoGet(_REMOTE, '%s/labels/hello' % base)) self.assertEqual('', DoDelete(_REMOTE, '%s/labels/hello' % base)) self.assertEqual(0, len(DoGet(_REMOTE, base) ['Labels'])) self.assertRaises(Exception, lambda: DoGet(_REMOTE, '%s/labels/hello' % base)) + self.assertEqual('', DoPut(_REMOTE, '%s/labels/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.' % base)) else: print("Your database backend doesn't support labels")