How to use the pyp2rpm.package_getters.PypiDownloader function in pyp2rpm

To help you get started, we’ve selected a few pyp2rpm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fedora-python / pyp2rpm / tests / test_package_getters.py View on Github external
def test_init_good_data(self, name, version, expected_ver):
        d = PypiDownloader(self.client, name, version)
        assert d.version == expected_ver
github fedora-python / pyp2rpm / tests / test_package_getters.py View on Github external
def test_init_bad_data(self, name, version):
        with pytest.raises(NoSuchPackageException):
            PypiDownloader(self.client, name, version)
github fedora-python / pyp2rpm / tests / test_convertor.py View on Github external
        ('spam', PypiDownloader),
        ('{0}restsh-0.1.tar.gz'.format(td_dir), LocalFileGetter)
    ])
    def test_getter_good_data(self, sf, g):
        c = Convertor(package=sf)
        assert isinstance(c.getter, g)
github fedora-python / pyp2rpm / tests / test_package_getters.py View on Github external
def test_init_good_data_pre(self, name, version, expected_ver):
        d = PypiDownloader(self.client, name, version, prerelease=True)
        assert d.version == expected_ver
github fedora-python / pyp2rpm / pyp2rpm / convertor.py View on Github external
Instance of the proper PackageGetter subclass according to
            provided argument.
        Raises:
            NoSuchSourceException if source to get the package from is unknown
            NoSuchPackageException if the package is unknown on PyPI
        """
        if not hasattr(self, '_getter'):
            if not self.pypi:
                self._getter = package_getters.LocalFileGetter(
                    self.package,
                    self.save_dir)
            else:
                logger.debug(
                    '{0} does not exist as local file trying PyPI.'.format(
                        self.package))
                self._getter = package_getters.PypiDownloader(
                    self.client,
                    self.package,
                    self.version,
                    self.prerelease,
                    self.save_dir)

        return self._getter