def setup_method(self, method):
        # create fresh extractors for every test

        self.nc = NameConvertor('fedora')
        self.e = [
            LocalMetadataExtractor(
                '{0}plumbum-0.9.0.tar.gz'.format(self.td_dir), 'plumbum',
                self.nc, '0.9.0'),
            LocalMetadataExtractor('{0}pytest-2.2.3.zip'.format(self.td_dir),
                                   'pytest', self.nc, '2.2.3'),
            LocalMetadataExtractor('{0}restsh-0.1.tar.gz'.format(self.td_dir),
                                   'restsh', self.nc, '0.1'),
            LocalMetadataExtractor(
                '{0}Sphinx-1.1.3-py2.6.egg'.format(self.td_dir), 'Sphinx',
                self.nc, '1.1.3'),
            LocalMetadataExtractor(
                '{0}unextractable-1.tar'.format(self.td_dir), 'unextractable',
                self.nc, '1'),
            LocalMetadataExtractor(
                '{0}bitarray-0.8.0.tar.gz'.format(self.td_dir), 'bitarray',
                self.nc, '0.8.0'),
            LocalMetadataExtractor(
                '{0}versiontools-1.9.1.tar.gz'.format(self.td_dir),
                'versiontools', self.nc, '1.9.1'),
        ]
 def setup_method(self, method):  # test for non-egg and egg
     self.nc = NameConvertor('fedora')
     self.e = [me.SetupPyMetadataExtractor('{0}plumbum-0.9.0.tar.gz'.format(
         self.td_dir), 'plumbum', self.nc, '0.9.0'),
         me.SetupPyMetadataExtractor(
         '{0}Sphinx-1.1.3-py2.6.egg'.format(self.td_dir), 'Sphinx', self.nc, '1.1.3')
     ]
Esempio n. 3
0
class TestUtils(object):
    def setup_method(self, method):
        self.ncf = NameConvertor('fedora')
        self.ncm = NameConvertor('mageia')
        self.ncb = NameConvertor('blackpantheros')

    @pytest.mark.parametrize(
        ('input', 'expected_f', 'expected_m', 'expected_b'), [
            ('python-spam', 'python-spam', 'python-spam', 'python-spam'),
            ('python-PySpam', 'python-PySpam', 'python-pyspam',
             'python-pyspam'),
            ('python-spampy', 'python-spampy', 'python-spampy',
             'python-spampy'),
            ('spam-python', 'python-spam', 'python-spam', 'python-spam'),
            ('python26-foo', 'python-foo', 'python-foo', 'python-foo'),
            ('foo-python26', 'python-foo', 'python-foo', 'python-foo'),
            ('python3-foo', 'python-foo', 'python-foo', 'python-foo'),
            ('foo-python3', 'python-foo', 'python-foo', 'python-foo'),
        ])
    def test_rpm_name(self, input, expected_f, expected_m, expected_b):
        assert self.ncf.rpm_name(input) == expected_f
        assert self.ncm.rpm_name(input) == expected_m
        assert self.ncb.rpm_name(input) == expected_b

    @pytest.mark.parametrize(('name', 'version', 'expected'), [
        ('python-spam', None, 'python-spam'),
        ('pyspam', None, 'pyspam'),
        ('python-spam', '3', 'python-spam'),
        ('pyspam', '26', 'python26-pyspam'),
        ('pyspam', settings.DEFAULT_PYTHON_VERSION, 'pyspam'),
        ('python-foo', '26', 'python26-foo'),
        ('python-foo', '3', 'python-foo'),
        ('python2-foo', None, 'python-foo'),
        ('python2-foo', '3', 'python-foo'),
        ('python26-foo', '3', 'python-foo'),
        ('python26-foo', None, 'python-foo'),
        ('python-foo', '25', 'python25-foo'),
        ('python2-devel', 3, 'python3-devel'),
        ('python2-devel', None, 'python2-devel'),
        ('python2dist(spam)', 3, 'python3dist(spam)'),
        ('python2dist(spam)', 2, 'python2dist(spam)'),
    ])
    def test_rpm_versioned_name(self, name, version, expected):
        assert NameConvertor.rpm_versioned_name(name, version) == expected
 def setup_method(self, method):
     self.nc = NameConvertor('fedora')
     self.e = []
     for archive, name, version in [
             ('setuptools-19.6-py2.py3-none-any.whl',
              'setuptools', '19.6.2'),
             ('py2exe-0.9.2.2-py33.py34-none-any.whl',
              'py2exe', '0.9.2.2')]:
         self.e.append(me.WheelMetadataExtractor('{0}{1}'.format(
             self.td_dir, archive), name, self.nc, version, venv=False))
Esempio n. 5
0
 def setup_method(self, method):
     self.nc = NameConvertor('fedora')
     self.e = []
     for archive in ('plumbum-0.9.0.tar.gz', 'pytest-2.2.3.zip',
                     'simpleeval-0.8.7.tar.gz',
                     'coverage_pth-0.0.1.tar.gz'):
         name, version = archive.split('-')
         self.e.append(
             me.SetupPyMetadataExtractor(
                 '{0}{1}'.format(self.td_dir, archive), name, self.nc,
                 version[:5]))
Esempio n. 6
0
class TestUtils(object):

    def setup_method(self, method):
        self.ncf = NameConvertor('fedora')
        self.ncm = NameConvertor('mageia')

    @pytest.mark.parametrize(('input', 'expected_f', 'expected_m'), [
        ('python-spam', 'python-spam', 'python-spam'),
        ('python-PySpam', 'python-PySpam', 'python-pyspam'),
        ('python-spampy', 'python-spampy', 'python-spampy'),
        ('spam-python', 'python-spam', 'python-spam'),
        ('python26-foo', 'python-foo', 'python-foo'),
        ('foo-python26', 'python-foo', 'python-foo'),
        ('python3-foo', 'python-foo', 'python-foo'),
        ('foo-python3', 'python-foo', 'python-foo'),
    ])
    def test_rpm_name(self, input, expected_f, expected_m):
        assert self.ncf.rpm_name(input) == expected_f
        assert self.ncm.rpm_name(input) == expected_m

    @pytest.mark.parametrize(('name', 'version', 'expected'), [
        ('python-spam', None, 'python-spam'),
        ('pyspam', None, 'pyspam'),
        ('python-spam', '3', 'python3-spam'),
        ('pyspam', '26', 'python26-pyspam'),
        ('pyspam', settings.DEFAULT_PYTHON_VERSION, 'pyspam'),
        ('python-foo', '26', 'python26-foo'),
        ('python-foo', '3', 'python3-foo'),
        ('python2-foo', None, 'python-foo'),
        ('python2-foo', '3', 'python3-foo'),
        ('python26-foo', '3', 'python3-foo'),
        ('python26-foo', None, 'python-foo'),
        ('python-foo', '25', 'python25-foo'),
        ('python2-devel', 3, 'python3-devel'),
        ('python2-devel', None, 'python2-devel'),
    ])
    def test_rpm_versioned_name(self, name, version, expected):
        assert NameConvertor.rpm_versioned_name(name, version) == expected
Esempio n. 7
0
class TestUtils(object):
    def setup_method(self, method):
        self.ncf = NameConvertor('fedora')
        self.ncm = NameConvertor('mageia')

    @pytest.mark.parametrize(('input', 'expected_f', 'expected_m'),
                             [('python-spam', 'python-spam', 'python-spam'),
                              ('PySpam', 'PySpam', 'python-pyspam'),
                              ('spampy', 'spampy', 'python-spampy'),
                              ('spam-python', 'python-spam', 'python-spam')])
    def test_rpm_name(self, input, expected_f, expected_m):
        assert self.ncf.rpm_name(input) == expected_f
        assert self.ncm.rpm_name(input) == expected_m

    @pytest.mark.parametrize(('name', 'version', 'expected'), [
        ('python-spam', None, 'python-spam'),
        ('pyspam', None, 'pyspam'),
        ('python-spam', '3', 'python3-spam'),
        ('pyspam', '26', 'python26-pyspam'),
        ('pyspam', settings.DEFAULT_PYTHON_VERSION, 'pyspam'),
    ])
    def test_rpm_versioned_name(self, name, version, expected):
        assert NameConvertor.rpm_versioned_name(name, version) == expected
    def setup_method(self, method):
        # create fresh extractors for every test

        self.nc = NameConvertor('fedora')
        self.e = [me.SetupPyMetadataExtractor('{0}plumbum-0.9.0.tar.gz'.format(
            self.td_dir), 'plumbum', self.nc, '0.9.0'),
            me.SetupPyMetadataExtractor(
            '{0}pytest-2.2.3.zip'.format(self.td_dir), 'pytest',
                self.nc, '2.2.3'),
            me.SetupPyMetadataExtractor(
            '{0}bitarray-0.8.0.tar.gz'.format(self.td_dir), 'bitarray',
                self.nc, '0.8.0'),
            me.SetupPyMetadataExtractor(
            '{0}versiontools-1.9.1.tar.gz'.format(self.td_dir),
                'versiontools', self.nc, '1.9.1'),
            me.SetupPyMetadataExtractor(
            '{0}isholiday-0.1.tar.gz'.format(self.td_dir),
                'isholiday', self.nc, '0.1'),
        ]
 def setup_method(self, method):
     self.nc = NameConvertor('fedora')
     # we will only test getting stuff from the client => pass spam as file
     self.e = me.SetupPyMetadataExtractor('spam', 'restsh', self.nc, '0.1')
Esempio n. 10
0
 def setup_method(self, method):
     self.nc = NameConvertor('fedora')
     # we will only test getting stuff from the client => pass spam as file
     self.e = me.SetupPyMetadataExtractor(
         '{0}pytest-2.2.3.zip'.format(self.td_dir), 'pytest', self.nc,
         '2.2.3')
Esempio n. 11
0
 def setup_method(self, method):
     self.ncf = NameConvertor('fedora')
     self.ncm = NameConvertor('mageia')
Esempio n. 12
0
 def test_rpm_versioned_name(self, name, version, expected):
     assert NameConvertor.rpm_versioned_name(name, version) == expected
Esempio n. 13
0
 def setup_method(self, method):
     self.temp_dir = tempfile.mkdtemp()
     self.venv = VirtualEnv(None, self.temp_dir,
                            NameConvertor(DEFAULT_DISTRO),
                            DEFAULT_PYTHON_VERSION)
Esempio n. 14
0
 def setup_method(self, method):
     self.nc = NameConvertor('fedora')
     self.e = [me.DistMetadataExtractor('{0}plumbum-0.9.0.tar.gz'.format(
         self.td_dir), 'plumbum', self.nc, '0.9.0'),
         me.DistMetadataExtractor('{0}coverage_pth-0.0.1.tar.gz'.format(
             self.td_dir), 'coverage_pth', self.nc, '0.0.1')]
Esempio n. 15
0
 def setup_method(self, method):
     self.nc = NameConvertor('fedora')
     self.e = (me.WheelMetadataExtractor('{0}setuptools-19.6-py2.py3-none-any.whl'.format(
         self.td_dir), 'setuptools', self.nc, '19.6.2'))
Esempio n. 16
0
 def setup_method(self, method):
     self.ncf = NameConvertor('fedora')
     self.ncm = NameConvertor('mageia')
     self.ncb = NameConvertor('blackpantheros')
Esempio n. 17
0
 def setup_method(self, method):
     self.ncf = NameConvertor('fedora')
     self.ncm = NameConvertor('mageia')
Esempio n. 18
0
 def test_rpm_versioned_name(self, name, version, expected):
     assert NameConvertor.rpm_versioned_name(name, version) == expected