fix tests, now we pass them all
This commit is contained in:
@@ -511,6 +511,7 @@ def is_package_name(fn, package_name = None):
|
||||
|
||||
def env_update():
|
||||
|
||||
ctx.ui.info(_('Updating environment...'))
|
||||
env_dir = join_path(ctx.config.dest_dir(), "/etc/env.d")
|
||||
profile_file = join_path(ctx.config.dest_dir(), "/etc/profile.env")
|
||||
ldconf_file = join_path(ctx.config.dest_dir(), "/etc/ld.so.conf")
|
||||
|
||||
@@ -31,7 +31,7 @@ class ArchiveFileTestCase(testcase.TestCase):
|
||||
|
||||
achv = sourcearchive.SourceArchive(bctx)
|
||||
|
||||
assert bctx.spec.source.archiveType == "targz"
|
||||
assert bctx.spec.source.archive.type == "targz"
|
||||
|
||||
# skip fetching and directly unpack the previously fetched (by
|
||||
# fetchertests) archive
|
||||
@@ -54,11 +54,11 @@ class ArchiveFileTestCase(testcase.TestCase):
|
||||
def testUnpackZip(self):
|
||||
bctx = BuildContext("tests/pccts/pspec.xml")
|
||||
|
||||
assert bctx.spec.source.archiveType == "zip"
|
||||
assert bctx.spec.source.archive.type == "zip"
|
||||
|
||||
achv = sourcearchive.SourceArchive(bctx)
|
||||
achv.fetch(interactive=False)
|
||||
achv.unpack(cleanDir=True)
|
||||
achv.unpack(clean_dir=True)
|
||||
|
||||
targetDir = bctx.pkg_work_dir()
|
||||
assert pathexists(targetDir + "/pccts")
|
||||
@@ -82,7 +82,7 @@ class ArchiveFileTestCase(testcase.TestCase):
|
||||
targetDir = bctx.pkg_work_dir()
|
||||
achv = sourcearchive.SourceArchive(bctx)
|
||||
achv.fetch(interactive=False)
|
||||
achv.unpack(cleanDir=True)
|
||||
achv.unpack(clean_dir=True)
|
||||
del achv
|
||||
|
||||
newZip = targetDir + "/new.zip"
|
||||
@@ -95,17 +95,17 @@ class ArchiveFileTestCase(testcase.TestCase):
|
||||
|
||||
def testUnpackZipCond(self):
|
||||
bctx = BuildContext("tests/pccts/pspec.xml")
|
||||
url = uri.URI(bctx.spec.source.archiveUri)
|
||||
url = uri.URI(bctx.spec.source.archive.uri)
|
||||
targetDir = bctx.pkg_work_dir()
|
||||
filePath = join(ctx.config.archives_dir(), url.filename())
|
||||
|
||||
# check cached
|
||||
if util.sha1_file(filePath) != bctx.spec.source.archiveSHA1:
|
||||
fetch = fetcher.Fetcher(bctx.spec.source.archiveUri, targetDir)
|
||||
if util.sha1_file(filePath) != bctx.spec.source.archive.sha1sum:
|
||||
fetch = fetcher.Fetcher(bctx.spec.source.archive.uri, targetDir)
|
||||
fetch.fetch()
|
||||
assert bctx.spec.source.archiveType == "zip"
|
||||
assert bctx.spec.source.archive.type == "zip"
|
||||
|
||||
achv = archive.Archive(filePath, bctx.spec.source.archiveType)
|
||||
achv = archive.Archive(filePath, bctx.spec.source.archive.type)
|
||||
achv.unpack_files(["pccts/history.txt"], targetDir)
|
||||
assert pathexists(targetDir + "/pccts")
|
||||
testfile = targetDir + "/pccts/history.txt"
|
||||
|
||||
@@ -20,7 +20,7 @@ class DependencyTestCase(unittest.TestCase):
|
||||
|
||||
def testDep(self):
|
||||
# a real life story bug #603
|
||||
gtkmmdep = DepInfo()
|
||||
gtkmmdep = Dependency()
|
||||
gtkmmdep.versionFrom = '1.9.1'
|
||||
gtkmmdep.package = 'atk'
|
||||
self.assert_( not gtkmmdep.satisfies('atk', '1.8.0', 1) )
|
||||
|
||||
@@ -26,7 +26,7 @@ class FetcherTestCase(testcase.TestCase):
|
||||
|
||||
self.spec = SpecFile()
|
||||
self.spec.read("tests/helloworld/pspec.xml")
|
||||
self.url = uri.URI(self.spec.source.archiveUri)
|
||||
self.url = uri.URI(self.spec.source.archive.uri)
|
||||
self.destpath = ctx.config.archives_dir()
|
||||
self.fetch = fetcher.Fetcher(self.url, self.destpath)
|
||||
|
||||
@@ -35,7 +35,7 @@ class FetcherTestCase(testcase.TestCase):
|
||||
fetchedFile = os.path.join(self.destpath, self.url.filename())
|
||||
if os.access(fetchedFile, os.R_OK):
|
||||
self.assertEqual(util.sha1_file(fetchedFile),
|
||||
self.spec.source.archiveSHA1)
|
||||
self.spec.source.archive.sha1sum)
|
||||
os.remove(fetchedFile)
|
||||
|
||||
def testResume(self):
|
||||
@@ -45,7 +45,7 @@ class FetcherTestCase(testcase.TestCase):
|
||||
fetchedFile = os.path.join(self.destpath, self.url.filename())
|
||||
if os.access(fetchedFile, os.R_OK):
|
||||
self.assertEqual(util.sha1_file(fetchedFile),
|
||||
self.spec.source.archiveSHA1)
|
||||
self.spec.source.archive.sha1sum)
|
||||
os.remove(fetchedFile)
|
||||
|
||||
suite = unittest.makeSuite(FetcherTestCase)
|
||||
|
||||
Reference in New Issue
Block a user