156
|
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) |