Exemplo n.º 1
0
 def testdownload(self):
     """testDownload."""
     p = tmp
     bd = Buildout(fp, [])
     bd.offline = False
     recipe = MinitageCommonRecipe(bd, '666', bd['part'])
     ret = recipe._download()
     self.assertTrue(
         os.path.isfile(os.path.join(recipe.download_cache,
                                     'buildouttest')))
     p = tmp
     bd = Buildout(fp, [])
     bd.offline = True
     open(os.path.join(p, 'a'), 'w').write('test')
     recipe = MinitageCommonRecipe(bd, '666', bd['part'])
     recipe.url = 'http://foo/a'
     recipe.download_cache = p
     ret = recipe._download()
     self.assertEquals(ret, os.path.join(p, 'a'))
Exemplo n.º 2
0
 def testdownload(self):
     """testDownload."""
     p = tmp
     bd = Buildout(fp, [])
     bd.offline = False
     recipe = MinitageCommonRecipe(bd, '666', bd['part'])
     ret = recipe._download()
     self.assertTrue(
         os.path.isfile(
             os.path.join(recipe.download_cache, 'buildouttest')
         )
     )
     p = tmp
     bd = Buildout(fp, [])
     bd.offline = True
     open(os.path.join(p, 'a'), 'w').write('test')
     recipe = MinitageCommonRecipe(bd, '666', bd['part'])
     recipe.url = 'http://foo/a'
     recipe.download_cache = p
     ret = recipe._download()
     self.assertEquals(
         ret,
         os.path.join(p, 'a')
     )