changeset 38:d147e36c6d18

test_create_series
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 21 Aug 2015 14:52:31 +0200
parents 6f86a5168e68
children 7412a437ab47
files Tests/Tests.py
diffstat 1 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Tests/Tests.py	Thu Aug 20 17:41:12 2015 +0200
+++ b/Tests/Tests.py	Fri Aug 21 14:52:31 2015 +0200
@@ -1222,6 +1222,10 @@
         png = GetImage(_REMOTE, '/instances/%s/preview' % i['ID'])
         self.assertEqual((5, 5), png.size)
 
+        j = DoGet(_REMOTE, i['Path'])
+        self.assertEqual('Instance', j['Type'])
+        self.assertEqual(j['ID'], i['ID'])
+
 
     def test_pilates(self):
         # "SCU failed error when accessing orthanc with osirix" by
@@ -2171,3 +2175,23 @@
         self.assertEqual(ComputeMD5(b), ComputeMD5(pdf))
 
         self.assertRaises(Exception, lambda: DoGet(_REMOTE, '/instances/%s/pdf' % brainixInstance))
+
+
+    def test_create_series(self):
+        i = DoPost(_REMOTE, '/tools/create-dicom',
+                   json.dumps({
+                    'Tags' : {
+                        'PatientName' : 'Jodogne',
+                        'Modality' : 'CT',
+                        },
+                    'Content' : [
+                        'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==', # red dot in RGBA
+                        'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAoUlEQVQ4jZ2SWw3EIBREjwUsYAELa2EtoAULFUCyXAtroRZqoRbox254BdLC/DZnZjoXWJFgCDg8egW2CBEhEnDzyRk+Ecxz2KP/0AL8S99T+jQccAVs22qKwAuPuq0uyNg9cPLh3am+pe/dkHLZtqJHj6vXJrZ7nvzvxxgemXgUwnGfXqpee09mUwp8m022OYP6bLF7mVuVe0y/umxinsAXRd9z0k1ubWsAAAAASUVORK5CYII=',
+                        ]
+                    }))
+
+        s = DoGet(_REMOTE, i['Path'])
+        self.assertEqual('Series', s['Type'])
+        self.assertEqual(s['ID'], i['ID'])
+        self.assertEqual(2, len(s['Instances']))
+