From 77a1046d2a84fb196e8c064cece714929edb5d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Thu, 3 Nov 2005 20:09:12 +0000 Subject: [PATCH] * name fixes: * remove obsolete test --- pisi/atomicoperations.py | 4 +- pisi/package.py | 2 +- tests/specfileoldtests.py | 83 --------------------------------------- 3 files changed, 3 insertions(+), 86 deletions(-) delete mode 100644 tests/specfileoldtests.py diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index 649bd23f..c571eba4 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -416,7 +416,7 @@ def resurrect_package(package_fn): metadata = MetaData() metadata.read(metadata_xml) - errs = metadata.has_errors() + errs = metadata.errors() if errs: util.Checks.print_errors(errs) raise Error, _("MetaData format wrong (%s)") % package_fn @@ -430,7 +430,7 @@ def resurrect_package(package_fn): files = Files() files.read(files_xml) - if files.has_errors(): + if files.errors(): raise Error, _("Invalid %s") % ctx.const.files_xml import pisi.atomicoperations diff --git a/pisi/package.py b/pisi/package.py index 3c18873d..1f65a583 100644 --- a/pisi/package.py +++ b/pisi/package.py @@ -107,7 +107,7 @@ class Package: self.files = Files() self.files.read( join(outdir, ctx.const.files_xml) ) - if self.files.has_errors(): + if self.files.errors(): raise Error, _("Invalid %s") % ctx.const.files_xml def pkg_dir(self): diff --git a/tests/specfileoldtests.py b/tests/specfileoldtests.py deleted file mode 100644 index d8befa79..00000000 --- a/tests/specfileoldtests.py +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# Please read the COPYING file. -# - -import unittest -import os - -from pisi import specfileold as specfile -import pisi.context as ctx -import pisi.util as util - -import testcase - -class SpecFileTestCase(testcase.TestCase): - def setUp(self): - testcase.TestCase.setUp(self) - self.spec = specfile.SpecFile() - self.spec.read("tests/popt/pspec.xml") - - def testReadSpec(self): - self.assertEqual(self.spec.source.name, "popt") - - self.assertEqual(self.spec.source.version, "1.7") - - self.assertEqual(self.spec.source.release, "3") - - self.assertEqual(self.spec.source.archiveSHA1, - "66f3c77b87a160951b180447f4a6dce68ad2f71b") - - patches = self.spec.source.patches - self.assertEqual(len(patches), 1) - patch = patches[0] #get first and the only patch - self.assertEqual(patch.filename, "popt-1.7-uclibc.patch.gz") - self.assertEqual(patch.compressionType, "gz") - - packages = self.spec.packages - self.assertEqual(len(packages), 1) - package = packages[0] # get the first and the only package - self.assertEqual(package.name, "popt-libs") - - # search for a path in package.paths - pn = "/usr/lib" - matched = [p for p in package.paths if p.pathname == pn] - if not matched: - self.fail("Failed to match pathname: %s" %pn) - - def testIsAPartOf(self): - # test existence in Source - if not "library:util:optparser" in self.spec.source.isa: - self.fail("Failed to match IsA in Source") - if not isinstance(self.spec.source.isa, list): - self.fail("source.isa is not a list, but it must be...") - - if "rpm:archive" != self.spec.source.partof: - self.fail("Failed to match PartOf in Source") - - # test existence in Package - pkg = self.spec.packages[0] - if not "library:util:optparser" in pkg.isa: - self.fail("Failed to match IsA in Package") - if not isinstance(pkg.isa, list): - self.fail("source.isa is not a list, but it must be...") - - if "rpm:archive" != pkg.partof: - self.fail("Failed to match PartOf in Package") - - def testVerify(self): - if self.spec.has_errors(): - self.fail("Failed to verify specfile") - - def testCopy(self): - self.spec.read("tests/popt/pspec.xml") - util.check_dir(ctx.config.tmp_dir()) - self.spec.write(os.path.join(ctx.config.tmp_dir(), 'popt-copy.pspec.xml')) - - -suite = unittest.makeSuite(SpecFileTestCase)