Example #1
0
 def test_version_conflicts_check(self):
     with Context() as finalizers:
         # Check that version conflicts raise an exception.
         directory = finalizers.mkdtemp()
         root_package, conflicting_package = self.create_version_conflict(directory)
         packages_to_scan = collect_related_packages(root_package)
         # Test the duplicate files check.
         self.assertRaises(VersionConflictFound, check_version_conflicts, packages_to_scan, self.package_cache)
         # Test for lack of duplicate files.
         os.unlink(conflicting_package)
         self.assertEqual(check_version_conflicts(packages_to_scan, cache=self.package_cache), None)
Example #2
0
 def test_version_conflicts_check(self):
     """Test static analysis of version conflicts."""
     with Context() as finalizers:
         # Check that version conflicts raise an exception.
         directory = finalizers.mkdtemp()
         root_package, conflicting_package = self.create_version_conflict(directory)
         packages_to_scan = collect_related_packages(root_package)
         # Test the duplicate files check.
         self.assertRaises(VersionConflictFound, check_version_conflicts, packages_to_scan, self.package_cache)
         # Test for lack of duplicate files.
         os.unlink(conflicting_package)
         assert check_version_conflicts(packages_to_scan, cache=self.package_cache) is None