예제 #1
0
    def test_package_not_found_mentions_metadata(self):
        """
        When a package is not found, that could indicate that the
        packgae is not installed or that it is installed without
        metadata. Ensure the exception mentions metadata to help
        guide users toward the cause. See #124.
        """
        with self.assertRaises(PackageNotFoundError) as ctx:
            Distribution.from_name('does-not-exist')

        assert "metadata" in str(ctx.exception)
예제 #2
0
 def test_for_name_does_not_exist(self):
     with self.assertRaises(PackageNotFoundError):
         Distribution.from_name('does-not-exist')
예제 #3
0
 def test_retrieves_version_of_self(self):
     dist = Distribution.from_name('distinfo-pkg')
     assert isinstance(dist.version, str)
     assert re.match(self.version_pattern, dist.version)