Mercurial > hg > orthanc-tests
changeset 236:2de1aec255ae
test_find_normalize
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 14 May 2019 10:29:58 +0200 |
parents | 9929e4af2b7a |
children | 21aa666c8fa0 |
files | Tests/Tests.py |
diffstat | 1 files changed, 35 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Tests/Tests.py Mon May 06 15:23:19 2019 +0200 +++ b/Tests/Tests.py Tue May 14 10:29:58 2019 +0200 @@ -4667,3 +4667,38 @@ self.assertEqual('RadioButton3', t['Name']) self.assertEqual('RadioLogic', t['PrivateCreator']) self.assertEqual('aaabbbccc', t['Value']) + + + def test_find_normalize(self): + # https://groups.google.com/d/msg/orthanc-users/AIwooGjsh94/YL28MNY4AgAJ + + UploadInstance(_REMOTE, 'Knee/T1/IM-0001-0001.dcm') + + a = DoPost(_REMOTE, '/modalities/self/query', { + 'Level' : 'Instance', + 'Query' : { 'Rows' : '42' } + }) ['ID'] + + b = DoGet(_REMOTE, '/queries/%s/answers?expand&simplify' % a) + self.assertEqual(1, len(b)) + self.assertFalse('Rows' in b[0]) + + a = DoPost(_REMOTE, '/modalities/self/query', { + 'Level' : 'Instance', + 'Query' : { 'Rows' : '42' }, + 'Normalize' : False + }) ['ID'] + + b = DoGet(_REMOTE, '/queries/%s/answers' % a) + self.assertEqual(0, len(b)) + + a = DoPost(_REMOTE, '/modalities/self/query', { + 'Level' : 'Instance', + 'Query' : { 'Rows' : '512' }, + 'Normalize' : False + }) ['ID'] + + b = DoGet(_REMOTE, '/queries/%s/answers?expand&simplify' % a) + self.assertEqual(1, len(b)) + self.assertTrue('Rows' in b[0]) + self.assertEqual('512', b[0]['Rows'])