Permalink
Browse files

ENH: for easier testing, avoid re-download of prostate mrb

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21364 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information...
pieper committed Nov 14, 2012
1 parent e1f8008 commit a39445d3fc87be1d89bea00951a1aa818f692a18
Showing with 5 additions and 2 deletions.
  1. +5 −2 Applications/SlicerApp/Testing/Python/RSNA2012ProstateDemo.py
@@ -188,8 +188,11 @@ def test_RSNA2012ProstateDemo(self):
# perform the downloads if needed, then load
filePath = slicer.app.temporaryPath + '/RSNA2012ProstateDemo.mrb'
urlPath = 'http://slicer.kitware.com/midas3/download?items=10697'
- self.delayDisplay('Downloading MRB from %s to %s...\n' % (urlPath, filePath))
- urllib.urlretrieve(urlPath, filePath)
+ if not os.path.exists(filePath) or os.stat(filePath).st_size == 0:
+ self.delayDisplay('Downloading MRB from %s to %s...\n' % (urlPath, filePath))
+ urllib.urlretrieve(urlPath, filePath)
+ else:
+ self.delayDisplay('Using existing %s...\n' % filePath)
slicer.mrmlScene.Clear(0)
appLogic = slicer.app.applicationLogic()
self.delayDisplay('Done loading data! Will now open the bundle')

0 comments on commit a39445d

Please sign in to comment.