fetcher testini düzelt.
This commit is contained in:
@@ -5,17 +5,21 @@ import os
|
|||||||
from pisi import fetcher
|
from pisi import fetcher
|
||||||
from pisi import util
|
from pisi import util
|
||||||
from pisi import context
|
from pisi import context
|
||||||
|
from pisi import config
|
||||||
|
from pisi import purl
|
||||||
|
|
||||||
class FetcherTestCase(unittest.TestCase):
|
class FetcherTestCase(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.ctx = context.BuildContext("samples/popt/popt.pspec")
|
self.ctx = context.BuildContext("samples/popt/popt.pspec")
|
||||||
self.fetch = fetcher.Fetcher(self.ctx.spec.source)
|
self.url = purl.PUrl(self.ctx.spec.source.archiveUri)
|
||||||
|
self.destpath = config.config.archives_dir()
|
||||||
|
self.fetch = fetcher.Fetcher(self.url, self.destpath)
|
||||||
|
|
||||||
def testFetch(self):
|
def testFetch(self):
|
||||||
self.fetch.fetch()
|
self.fetch.fetch()
|
||||||
destpath = self.fetch.filedest + "/" + self.fetch.filename
|
fetchedFile = os.path.join(self.destpath, self.url.filename())
|
||||||
if os.access(destpath, os.R_OK):
|
if os.access(fetchedFile, os.R_OK):
|
||||||
self.assertEqual(util.sha1_file(destpath),
|
self.assertEqual(util.sha1_file(fetchedFile),
|
||||||
self.ctx.spec.source.archiveSHA1)
|
self.ctx.spec.source.archiveSHA1)
|
||||||
|
|
||||||
suite = unittest.makeSuite(FetcherTestCase)
|
suite = unittest.makeSuite(FetcherTestCase)
|
||||||
|
|||||||
Reference in New Issue
Block a user