summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndoni Morales Alastruey <ylatuya@gmail.com>2012-06-25 15:48:20 +0200
committerAndoni Morales Alastruey <ylatuya@gmail.com>2012-06-25 15:48:20 +0200
commit2207e802bc3988a7544712bba331295be8237eee (patch)
tree5fb934072298a62385336f9729dfce49d5080a31 /test
parent4b0734008f4de0155ba9cc543bca448411bad37d (diff)
test: fix tests after last changes
Diffstat (limited to 'test')
-rw-r--r--test/test_cerbero_config.py1
-rw-r--r--test/test_cerbero_packages_packagesstore.py27
-rw-r--r--test/test_cerbero_packages_pmdoc.py7
3 files changed, 23 insertions, 12 deletions
diff --git a/test/test_cerbero_config.py b/test/test_cerbero_config.py
index f8ce6b6..b697e9e 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 6cd4505..920650a 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 7ee83c4..f91e491 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')