comparison PerfsDb/TestConfig.py @ 161:27b3b0df5f90

2 upload tests
author am@osimis.io
date Fri, 17 Aug 2018 17:24:11 +0200
parents 6995d5d12d88
children 53575aa2614b
comparison
equal deleted inserted replaced
160:6995d5d12d88 161:27b3b0df5f90
40 40
41 def launchDbServer(self): 41 def launchDbServer(self):
42 if self._dbServer is not None: 42 if self._dbServer is not None:
43 self._dbServer.launch() 43 self._dbServer.launch()
44 44
45 def launchOrthanc(self, orthancPath) -> bool: 45 def launchOrthanc(self, orthancPath, verboseEnabled: bool=False, traceEnabled: bool=False) -> bool:
46 orthanc = OrthancClient("http://127.0.0.1:8042") 46 orthanc = OrthancClient("http://127.0.0.1:8042")
47 47
48 print("Checking if Orthanc is already running") 48 print("Checking if Orthanc is already running")
49 if orthanc.isAlive(): 49 if orthanc.isAlive():
50 print("Orthanc is already running") 50 print("Orthanc is already running")
51 return False 51 return False
52 52
53 print("Launching Orthanc") 53 print("Launching Orthanc")
54 self._orthancProcess = subprocess.Popen([ 54 runOrthancCommand = [
55 os.path.join(orthancPath, "Orthanc"), 55 os.path.join(orthancPath, "Orthanc"),
56 os.path.join(os.path.abspath(os.path.dirname(__file__)), "ConfigFiles", self.label + ".json"), 56 os.path.join(os.path.abspath(os.path.dirname(__file__)), "ConfigFiles", self.label + ".json"),
57 ]) 57 ]
58 if traceEnabled:
59 runOrthancCommand.append("--trace")
60 elif verboseEnabled:
61 runOrthancCommand.append("--verbose")
62
63 self._orthancProcess = subprocess.Popen(runOrthancCommand)
58 64
59 print("Waiting for Orthanc to start") 65 print("Waiting for Orthanc to start")
60 orthanc.waitStarted(timeout=30) 66 orthanc.waitStarted(timeout=30)
61 print("Orthanc has started") 67 print("Orthanc has started")
62 return True 68 return True