Mercurial > hg > orthanc-tests
annotate PerfsDb/Tests/UploadFile.py @ 158:df1f9946571c
perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
author | am@osimis.io |
---|---|
date | Fri, 17 Aug 2018 11:58:26 +0200 |
parents | f1a75985caa8 |
children | 27b3b0df5f90 |
rev | line source |
---|---|
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 | |
158
df1f9946571c
perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
am@osimis.io
parents:
156
diff
changeset
|
11 def beforeAll(self): |
156 | 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 | |
158
df1f9946571c
perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
am@osimis.io
parents:
156
diff
changeset
|
17 def beforeEach(self): |
156 | 18 # make sure the file is not in Orthanc before the upload |
19 self._orthanc.instances.delete(self._instanceId) | |
20 | |
21 def test(self): | |
22 self._orthanc.uploadDicom(self._dicomFileContent) |