Commit 7d4a4682ab9d67f25621657bdd658397b83ac2fb

Authored by Jürgen Knödlseder
1 parent d2b9f18d

Correct CTA file post-processing in test_python.py.

inst/cta/test/test_CTA.py
... ... @@ -271,8 +271,8 @@ class Test(gammalib.GPythonTestSuite):
271 271 # Load 1DC CTA observation (ARF, PSF, RMF)
272 272 self.test_try("Test 1DC responses")
273 273 try:
274   - filname = self.caldb + "/../data/irf_1dc.xml"
275   - obs = gammalib.GObservations(filname)
  274 + filename = self.caldb + "/../data/irf_1dc.xml"
  275 + obs = gammalib.GObservations(filename)
276 276 self.test_try_success()
277 277 except:
278 278 self.test_try_failure("Unable to load 1DC responses.")
... ...
test/test_python.py
... ... @@ -175,7 +175,10 @@ def test(installed=False):
175 175 filename = element.attribute("file")
176 176 head, tail = os.path.split(filename)
177 177 head, dir = os.path.split(head)
178   - filename = "cta/"+dir+"/"+tail
  178 + if len(tail) > 0:
  179 + filename = "cta/"+dir+"/"+tail
  180 + else:
  181 + filename = ""
179 182 element.attribute("file", filename)
180 183 xml.save("cta/data/irf_unbinned.xml")
181 184 xml = gammalib.GXml("cta/data/irf_1dc.xml")
... ... @@ -186,7 +189,10 @@ def test(installed=False):
186 189 head, dir = os.path.split(head)
187 190 if dir == "dc1":
188 191 dir = "caldb/dc1"
189   - filename = "cta/"+dir+"/"+tail
  192 + if len(tail) > 0:
  193 + filename = "cta/"+dir+"/"+tail
  194 + else:
  195 + filename = ""
190 196 element.attribute("file", filename)
191 197 xml.save("cta/data/irf_1dc.xml")
192 198  
... ...