comparison PerfsDb/Tests/UploadFile.py @ 156:f1a75985caa8

first Db test framework - work in progress
author am@osimis.io
date Thu, 16 Aug 2018 17:13:32 +0200
parents
children df1f9946571c
comparison
equal deleted inserted replaced
155:e0996602b306 156:f1a75985caa8
1 from Test import Test
2
3 class TestUploadFile(Test):
4
5 def __init__(self, name:str = "UploadFile", filePath:str = "../Database/DummyCT.dcm"):
6 super().__init__(name)
7 self._instanceId = None
8 self._filePath = filePath
9 self._dicomFileContent = None
10
11 def prepare(self):
12 # get the instance Id and dicom file content
13 if self._instanceId is None:
14 self._instanceId = self._orthanc.uploadDicomFile(self._filePath)
15 self._dicomFileContent = self._orthanc.instances.getDicom(self._instanceId)
16
17 # make sure the file is not in Orthanc before the upload
18 self._orthanc.instances.delete(self._instanceId)
19
20 def test(self):
21 self._orthanc.uploadDicom(self._dicomFileContent)