diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2012-06-25 15:48:20 +0200 |
---|---|---|
committer | Andoni Morales Alastruey <ylatuya@gmail.com> | 2012-06-25 15:48:20 +0200 |
commit | 2207e802bc3988a7544712bba331295be8237eee (patch) | |
tree | 5fb934072298a62385336f9729dfce49d5080a31 /test | |
parent | 4b0734008f4de0155ba9cc543bca448411bad37d (diff) |
test: fix tests after last changes
Diffstat (limited to 'test')
-rw-r--r-- | test/test_cerbero_config.py | 1 | ||||
-rw-r--r-- | test/test_cerbero_packages_packagesstore.py | 27 | ||||
-rw-r--r-- | test/test_cerbero_packages_pmdoc.py | 7 |
3 files changed, 23 insertions, 12 deletions
diff --git a/test/test_cerbero_config.py b/test/test_cerbero_config.py index f8ce6b62..b697e9e8 100644 --- a/test/test_cerbero_config.py +++ b/test/test_cerbero_config.py @@ -87,6 +87,7 @@ class LinuxPackagesTest(unittest.TestCase): 'allow_system_libs': True, 'external_packages': {}, 'external_recipes': {}, + 'use_ccache': None, } self.assertEquals(sorted(config._properties), sorted(props.keys())) for p, v in props.iteritems(): diff --git a/test/test_cerbero_packages_packagesstore.py b/test/test_cerbero_packages_packagesstore.py index 6cd45053..920650a9 100644 --- a/test/test_cerbero_packages_packagesstore.py +++ b/test/test_cerbero_packages_packagesstore.py @@ -21,7 +21,8 @@ import tempfile from cerbero.config import Platform from cerbero.errors import PackageNotFoundError -from cerbero.packages.package import Package, MetaPackage +from cerbero.packages.package import Package, MetaPackage, SDKPackage,\ + InstallerPackage, App from cerbero.packages.packagesstore import PackagesStore from test import test_packages_common as common @@ -38,12 +39,17 @@ class Package(package.Package): Architecture.X86 ''' -METAPACKAGE = ''' -class MetaPackage(package.MetaPackage): +SDKPACKAGE = ''' +class SDKPackage(package.SDKPackage): name = 'test-package' ''' +INSTALLERPACKAGE = ''' +class InstallerPackage(package.InstallerPackage): + + name = 'test-package' +''' class PackageTest(unittest.TestCase): @@ -112,12 +118,15 @@ class PackageTest(unittest.TestCase): self.assertEquals('test-package', p.name) def testLoadMetaPackageFromFile(self): - package_file = tempfile.NamedTemporaryFile() - package_file.write(METAPACKAGE) - package_file.flush() - p = self.store._load_package_from_file(package_file.name) - self.assertIsInstance(p, MetaPackage) - self.assertEquals('test-package', p.name) + for x, t in [(SDKPACKAGE, SDKPackage), + (INSTALLERPACKAGE, InstallerPackage)]: + package_file = tempfile.NamedTemporaryFile() + package_file.write(x) + package_file.flush() + p = self.store._load_package_from_file(package_file.name) + print p, type(p) + self.assertIsInstance(p, t) + self.assertEquals('test-package', p.name) def testImports(self): package_file = tempfile.NamedTemporaryFile() diff --git a/test/test_cerbero_packages_pmdoc.py b/test/test_cerbero_packages_pmdoc.py index 7ee83c46..f91e491c 100644 --- a/test/test_cerbero_packages_pmdoc.py +++ b/test/test_cerbero_packages_pmdoc.py @@ -106,8 +106,9 @@ class IndexTest(unittest.TestCase, XMLMixin): else: self.fail("Incorrect choice %s" % choice) elpkrefs = [x.attrib['id'] for x in \ - choice.iterfind(Index.TAG_PKGREF)] - self.assertEquals(sorted(pkrefs), sorted(elpkrefs)) + choice.iterfind(Index.TAG_PKGREF)] + self.assertEquals(sorted(["default.%s" %x for x in pkrefs]), + sorted(elpkrefs)) packages.extend(pkrefs) items = [x.text[:-4] for x in self.index.root.iterfind(Index.TAG_ITEM) if @@ -156,7 +157,7 @@ class PkgRefTest(unittest.TestCase, XMLMixin): self.pkgref._add_root() self.pkgref._add_config() config = self.find_one(self.pkgref.root, PkgRef.TAG_CONFIG) - self.check_text(config, PkgRef.TAG_IDENTIFIER, self.package.name) + self.check_text(config, PkgRef.TAG_IDENTIFIER, self.package.identifier()) self.check_text(config, PkgRef.TAG_VERSION, self.package.version) self.check_text(config, PkgRef.TAG_DESCRIPTION, self.package.shortdesc) self.check_attrib(config, PkgRef.TAG_POST_INSTALL, 'type', 'none') |