comparison Tests/Tests.py @ 177:ef6b791c6d62 Orthanc-1.4.2

fix version checks
author am@osimis.io
date Thu, 20 Sep 2018 12:38:37 +0200
parents 48cc188ffb09
children 8a2dd77d4035
comparison
equal deleted inserted replaced
176:48cc188ffb09 177:ef6b791c6d62
144 im = GetImage(_REMOTE, url) 144 im = GetImage(_REMOTE, url)
145 self.assertTrue(CompareLists(truth, im.getdata())) 145 self.assertTrue(CompareLists(truth, im.getdata()))
146 146
147 147
148 def test_system(self): 148 def test_system(self):
149 self.assertTrue('Version' in DoGet(_REMOTE, '/system'))
150 self.assertEqual('0', DoGet(_REMOTE, '/statistics')['TotalDiskSize'])
151 self.assertEqual('0', DoGet(_REMOTE, '/statistics')['TotalUncompressedSize'])
152
153 systemInfo = DoGet(_REMOTE, '/system')
154 if systemInfo["Version"] == "mainline":
155 print "Skipping version checks since you're currently in mainline"
156 return
157
149 self.assertTrue(IsOrthancVersionAbove(_LOCAL, 0, 8, 6)) 158 self.assertTrue(IsOrthancVersionAbove(_LOCAL, 0, 8, 6))
150 self.assertFalse(IsOrthancVersionAbove(_LOCAL, 0, 8, 7)) 159 self.assertFalse(IsOrthancVersionAbove(_LOCAL, 0, 8, 7))
151 self.assertTrue(IsOrthancVersionAbove(_LOCAL, 0, 7, 6)) 160 self.assertTrue(IsOrthancVersionAbove(_LOCAL, 0, 7, 6))
152 self.assertFalse(IsOrthancVersionAbove(_LOCAL, 0, 9, 6)) 161 self.assertFalse(IsOrthancVersionAbove(_LOCAL, 0, 9, 6))
153 self.assertFalse(IsOrthancVersionAbove(_LOCAL, 1, 8, 6)) 162 self.assertFalse(IsOrthancVersionAbove(_LOCAL, 1, 8, 6))
154 self.assertTrue('Version' in DoGet(_REMOTE, '/system'))
155 self.assertEqual('0', DoGet(_REMOTE, '/statistics')['TotalDiskSize'])
156 self.assertEqual('0', DoGet(_REMOTE, '/statistics')['TotalUncompressedSize'])
157 163
158 def test_upload(self): 164 def test_upload(self):
159 self.assertEqual('0', DoGet(_REMOTE, '/statistics')['TotalDiskSize']) 165 self.assertEqual('0', DoGet(_REMOTE, '/statistics')['TotalDiskSize'])
160 self.assertEqual('0', DoGet(_REMOTE, '/statistics')['TotalUncompressedSize']) 166 self.assertEqual('0', DoGet(_REMOTE, '/statistics')['TotalUncompressedSize'])
161 167