From 4d82f74e7ee6d149aa0d801996e067a046792a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Tue, 28 Jun 2005 09:22:14 +0000 Subject: [PATCH] =?UTF-8?q?fetcher=20testini=20d=C3=BCzelt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/fetchertests.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/fetchertests.py b/tests/fetchertests.py index ba3efa09..fe07b2b0 100644 --- a/tests/fetchertests.py +++ b/tests/fetchertests.py @@ -5,17 +5,21 @@ import os from pisi import fetcher from pisi import util from pisi import context +from pisi import config +from pisi import purl class FetcherTestCase(unittest.TestCase): def setUp(self): 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): self.fetch.fetch() - destpath = self.fetch.filedest + "/" + self.fetch.filename - if os.access(destpath, os.R_OK): - self.assertEqual(util.sha1_file(destpath), + fetchedFile = os.path.join(self.destpath, self.url.filename()) + if os.access(fetchedFile, os.R_OK): + self.assertEqual(util.sha1_file(fetchedFile), self.ctx.spec.source.archiveSHA1) suite = unittest.makeSuite(FetcherTestCase)