Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_rpm_versioned_name(self, name, version, expected):
assert NameConvertor.rpm_versioned_name(name, version) == expected
def name_for_python_version(name, version, default_number=False):
return name_convertor.NameConvertor.rpm_versioned_name(
name, version, default_number, True)
present in this class just for API compatibility reason
Returns:
Converted name of the package, that should be in line with
Fedora Packaging Guidelines. If for_python is not None,
the returned name is in form python%(version)s-%(name)s
"""
logger.debug("Converting name: {0} to rpm name, version: {1}.".format(
name, python_version))
rpmized_name = self.base_name(name)
rpmized_name = 'python-{0}'.format(rpmized_name)
if self.distro == 'mageia':
rpmized_name = rpmized_name.lower()
logger.debug('Rpmized name of {0}: {1}.'.format(name, rpmized_name))
return NameConvertor.rpm_versioned_name(rpmized_name, python_version)