Exemple #1
0
    def test_can_add_individual_dependencies_to_collection(self):
        """fab.tests.dependency.system_package_dependency_collection_test  Can add individual dependencies to the collection"""

        dependency_collection = SystemPackageDependencyCollection([], None, None)

        self.assertEqual(0, len(dependency_collection))

        for count in range(4):
            dependency_collection.add(self.mox.CreateMock(SystemPackageDependency))

        self.assertEqual(4, len(dependency_collection))
Exemple #2
0
    def exit_if_system_package_dependencies_not_met(self,
                                                    os_package_specifications):
        dependency_collection = SystemPackageDependencyCollection(
            os_package_specifications, self.os_package_inspector,
            self.feedback)

        self.os_package_verifier.exit_if_package_dependencies_not_met(
            dependency_collection)
Exemple #3
0
    def test_can_report_collection_length(self):
        """fab.tests.dependency.system_package_dependency_collection_test  Can report collection length"""

        dependency_collection = SystemPackageDependencyCollection(SystemPackageSpecifications.COMPILATION, None, None)

        expected_collection_length = len(SystemPackageSpecifications.COMPILATION)

        self.assertEqual(expected_collection_length, len(dependency_collection.dependencies))
        self.assertEqual(expected_collection_length, len(dependency_collection))
Exemple #4
0
    def test_initialiser_unpacks_package_specifications_and_adds_package_dependencies(self):
        """fab.tests.dependency.system_package_dependency_collection_test  Initialiser unpacks package specifications and adds package dependencies"""

        dependency_collection = SystemPackageDependencyCollection(SystemPackageSpecifications.COMPILATION, None, None)

        self.assertEqual(len(SystemPackageSpecifications.COMPILATION), len(dependency_collection))

        for current_index in range(len(SystemPackageSpecifications.COMPILATION)):
            package_spec = SystemPackageSpecifications.COMPILATION[current_index]
            expected_dependency = SystemPackageDependency.from_specification(package_spec)
            actual_dependency = dependency_collection.dependencies[current_index]
            self.assertEqual(expected_dependency, actual_dependency)
Exemple #5
0
    def test_can_find_unmet_dependencies(self):
        """fab.tests.dependency.system_package_dependency_collection_test  Can find unmet dependencies"""

        dependency_collection = SystemPackageDependencyCollection([], self.mock_package_inspector, self.mock_feedback)

        dependency_collection.add(self._create_unmet_package_dependency("package1"))
        dependency_collection.add(self._create_met_package_dependency("package2"))
        dependency_collection.add(self._create_unmet_package_dependency("package3"))
        dependency_collection.add(self._create_met_package_dependency("package4"))
        dependency_collection.add(self._create_met_package_dependency("package5"))

        self.mox.ReplayAll()

        self.assertEqual(["package1", "package3"], dependency_collection.find_unmet_dependencies())