diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2012-04-24 15:33:40 +0200 |
---|---|---|
committer | Andoni Morales Alastruey <ylatuya@gmail.com> | 2012-04-24 15:35:54 +0200 |
commit | 70ff524c0b6ea14a24ee8ff1e0bc33a2ad01bd81 (patch) | |
tree | c264a47ad307796f1fe68db7dcc8d6735c61e44d /test | |
parent | a512f592555944a24c656c376f6d416c366ea2ca (diff) |
tests: Fix tests
Diffstat (limited to 'test')
-rw-r--r-- | test/test_cerbero_packages_package.py | 15 | ||||
-rw-r--r-- | test/test_cerbero_packages_packagesstore.py | 19 | ||||
-rw-r--r-- | test/test_cerbero_packages_pmdoc.py | 2 | ||||
-rw-r--r-- | test/test_cerbero_packages_wix.py | 4 | ||||
-rw-r--r-- | test/test_packages_common.py | 2 |
5 files changed, 25 insertions, 17 deletions
diff --git a/test/test_cerbero_packages_package.py b/test/test_cerbero_packages_package.py index 5b2197c7..9fb15555 100644 --- a/test/test_cerbero_packages_package.py +++ b/test/test_cerbero_packages_package.py @@ -41,8 +41,10 @@ class PackageTest(unittest.TestCase): self.tmp = tempfile.mkdtemp() win32config = Config(self.tmp, Platform.WINDOWS) linuxconfig = Config(self.tmp, Platform.LINUX) - self.win32package = Package1(win32config, create_cookbook(win32config)) - self.linuxpackage = Package1(linuxconfig, create_cookbook(linuxconfig)) + self.win32package = Package1(win32config, create_store(win32config), + create_cookbook(win32config)) + self.linuxpackage = Package1(linuxconfig, create_store(linuxconfig), + create_cookbook(linuxconfig)) def tearDown(self): shutil.rmtree(self.tmp) @@ -62,10 +64,11 @@ class PackageTest(unittest.TestCase): self.assertEquals(self.win32package._recipes_files['recipe5'], ['libs']) def testListRecipesDeps(self): + print self.win32package.recipes_dependencies() self.assertEquals(self.win32package.recipes_dependencies(), - ['recipe1', 'recipe5']) + ['recipe1', 'recipe5', 'recipe2']) self.assertEquals(self.linuxpackage.recipes_dependencies(), - ['recipe1']) + ['recipe1', 'recipe2']) def testFilesList(self): add_files(self.tmp) @@ -101,11 +104,11 @@ class PackageTest(unittest.TestCase): def testSystemDependencies(self): config = Config(self.tmp, Platform.LINUX) config.target_distro = Distro.DEBIAN - package = Package4(config, None) + package = Package4(config, None, None) self.assertEquals(package.get_sys_deps(), ['python']) config.target_distro = Distro.REDHAT config.target_distro_version = DistroVersion.FEDORA_16 - package = Package4(config, None) + package = Package4(config, None, None) self.assertEquals(package.get_sys_deps(), ['python27']) diff --git a/test/test_cerbero_packages_packagesstore.py b/test/test_cerbero_packages_packagesstore.py index accd99ee..6cd45053 100644 --- a/test/test_cerbero_packages_packagesstore.py +++ b/test/test_cerbero_packages_packagesstore.py @@ -54,14 +54,14 @@ class PackageTest(unittest.TestCase): self.store = PackagesStore(self.config, False) def testAddPackage(self): - package = common.Package1(self.config, None) + package = common.Package1(self.config, None, None) self.assertEquals(len(self.store._packages), 0) self.store.add_package(package) self.assertEquals(len(self.store._packages), 1) self.assertEquals(package, self.store._packages[package.name]) def testGetPackage(self): - package = common.Package1(self.config, None) + package = common.Package1(self.config, None, None) self.store.add_package(package) self.assertEquals(package, self.store.get_package(package.name)) @@ -70,7 +70,7 @@ class PackageTest(unittest.TestCase): 'unknown') def testPackagesList(self): - package = common.Package1(self.config, None) + package = common.Package1(self.config, None, None) metapackage = common.MetaPackage(self.config, None) self.store.add_package(package) self.store.add_package(metapackage) @@ -78,8 +78,8 @@ class PackageTest(unittest.TestCase): self.assertEquals(l, self.store.get_packages_list()) def testPackageDeps(self): - package = common.Package1(self.config, None) - package2 = common.Package2(self.config, None) + package = common.Package1(self.config, None, None) + package2 = common.Package2(self.config, None, None) self.store.add_package(package) self.store.add_package(package2) self.assertEquals(package.deps, @@ -92,13 +92,16 @@ class PackageTest(unittest.TestCase): self.failUnlessRaises(PackageNotFoundError, self.store.get_package_deps, metapackage.name) for klass in [common.Package1, common.Package2, common.Package3, - common.Package4, common.MetaPackage]: + common.Package4]: + p = klass(self.config, None, None) + self.store.add_package(p) + for klass in [common.MetaPackage]: p = klass(self.config, None) self.store.add_package(p) deps = ['gstreamer-test-bindings', 'gstreamer-test1', 'gstreamer-test2', 'gstreamer-test3'] - self.assertEquals(deps, - [x.name for x in self.store.get_package_deps(metapackage.name)]) + res = [x.name for x in self.store.get_package_deps(metapackage.name)] + self.assertEquals(sorted(deps), sorted(res)) def testLoadPackageFromFile(self): package_file = tempfile.NamedTemporaryFile() diff --git a/test/test_cerbero_packages_pmdoc.py b/test/test_cerbero_packages_pmdoc.py index 2bebdc82..d253c0c8 100644 --- a/test/test_cerbero_packages_pmdoc.py +++ b/test/test_cerbero_packages_pmdoc.py @@ -120,7 +120,7 @@ class PkgRefTest(unittest.TestCase, XMLMixin): def setUp(self): self.config = DummyConfig() self.config.target_platform = Platform.LINUX - self.package = Package1(self.config, None) + self.package = Package1(self.config, None, None) self.package_path = '/test/package.pkg' self.pkgref = PkgRef(self.package, PackageType.RUNTIME, self.package_path) diff --git a/test/test_cerbero_packages_wix.py b/test/test_cerbero_packages_wix.py index 80aceed1..8a66d6c9 100644 --- a/test/test_cerbero_packages_wix.py +++ b/test/test_cerbero_packages_wix.py @@ -26,6 +26,7 @@ from cerbero.packages import package from cerbero.packages.wix import MergeModule from cerbero.utils import etree from test.test_build_common import create_cookbook +from test.test_packages_common import create_store from test.test_common import DummyConfig @@ -88,8 +89,9 @@ class MergeModuleTest(unittest.TestCase): def setUp(self): self.config = DummyConfig() cb = create_cookbook(self.config) + store = create_store(self.config) cb.add_recipe(Recipe1(self.config)) - self.package = Package(self.config, cb) + self.package = Package(self.config, store, cb) self.mergemodule = MergeModule(self.config, self.package.files_list(), self.package) diff --git a/test/test_packages_common.py b/test/test_packages_common.py index 4b338c98..33ff2a70 100644 --- a/test/test_packages_common.py +++ b/test/test_packages_common.py @@ -105,7 +105,7 @@ def create_store(config): store = PackagesStore(config, False) for klass in [Package1, Package2, Package3, Package4]: - package = klass(config, cookbook) + package = klass(config, store, cookbook) store.add_package(package) for klass in [MetaPackage]: package = klass(config, store) |