# Path: pyp2rpm/bin.py
# CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
# class Pyp2rpmCommand(click.Command):
# class SclizeOption(click.Option):
#     def format_options(self, ctx, formatter):
#     def handle_parse_result(self, ctx, opts, args):
#     def get_help_record(self, ctx):
#     def get_scl_help_record(self, ctx):
# def main(package, v, prerelease, d, s, r, proxy, srpm, p, b, o, t, venv, autonc,
#          sclize, **scl_kwargs):
# def convert_to_scl(spec, scl_options):


import pytest
import os
import tempfile
import shutil
    import dnf
from flexmock import flexmock
from scripttest import TestFileEnvironment
from pyp2rpm.bin import Convertor, SclConvertor, main, convert_to_scl
    def setup_method(self, method):
        self.temp_dir = tempfile.mkdtemp()
        self.env = TestFileEnvironment(self.temp_dir, start_clear=False)

    def teardown_method(self, method):
        shutil.rmtree(self.temp_dir)

    @pytest.mark.parametrize(('package', 'options', 'expected'), [
        ('Jinja2', '-v2.8', 'python-Jinja2_py3_autonc.spec'),
        ('Jinja2', '-v2.8 -p2', 'python-Jinja2_py23_autonc.spec'),
        ('Jinja2', '-v2.8 -b2', 'python-Jinja2_py2_autonc.spec'),
        ('Jinja2', '-v2.8 -b3', 'python-Jinja2_py3_autonc.spec'),
        ('Jinja2', '-v2.8 -b3 -p2 -t epel7', 'python-Jinja2_epel7{0}.spec'),
        ('Jinja2', '-v2.8 -t epel6', 'python-Jinja2_epel6{0}.spec'),
        ('Jinja2', '-v2.8 -p2 -t mageia', 'python-Jinja2_mageia_py23.spec'),
        ('Jinja2', '-v2.8 -p2 --no-autonc', 'python-Jinja2{0}.spec'),
        ('paperwork-backend', '-v1.2.4', 'python-paperwork-backend.spec'),
        ('Sphinx', '-v1.5 -r python-sphinx -p2', 'python-sphinx_autonc.spec'),
        ('{0}/test_data/utest-0.1.0.tar.gz'.format(tests_dir), '',
         'python-utest.spec'),
        ('{0}/test_data/utest-0.1.0.tar.gz'.format(tests_dir), '-t epel7',
         'python-utest_epel7.spec'),
    ])
    @pytest.mark.webtest
    def test_spec(self, package, options, expected):
        if 'autonc' in expected:
            variant = expected
        else:
            nc = '_dnfnc' if dnf is not None else '_nc'
            variant = expected.format(nc)

# Path: pyp2rpm/bin.py
# CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
# class Pyp2rpmCommand(click.Command):
# class SclizeOption(click.Option):
#     def format_options(self, ctx, formatter):
#     def handle_parse_result(self, ctx, opts, args):
#     def get_help_record(self, ctx):
#     def get_scl_help_record(self, ctx):
# def main(package, v, prerelease, d, s, r, proxy, srpm, p, b, o, t, venv, autonc,
#          sclize, **scl_kwargs):
# def convert_to_scl(spec, scl_options):


# Path: tests/test_integration.py
import pytest
import os
import tempfile
import shutil
    import dnf
from flexmock import flexmock
from scripttest import TestFileEnvironment
from pyp2rpm.bin import Convertor, SclConvertor, main, convert_to_scl

    def setup_method(self, method):
        self.temp_dir = tempfile.mkdtemp()
        self.env = TestFileEnvironment(self.temp_dir, start_clear=False)

    def teardown_method(self, method):
        shutil.rmtree(self.temp_dir)

    @pytest.mark.parametrize(('package', 'options', 'expected'), [
        ('Jinja2', '-v2.8', 'python-Jinja2_py3_autonc.spec'),
        ('Jinja2', '-v2.8 -p2', 'python-Jinja2_py23_autonc.spec'),
        ('Jinja2', '-v2.8 -b2', 'python-Jinja2_py2_autonc.spec'),
        ('Jinja2', '-v2.8 -b3', 'python-Jinja2_py3_autonc.spec'),
        ('Jinja2', '-v2.8 -b3 -p2 -t epel7', 'python-Jinja2_epel7{0}.spec'),
        ('Jinja2', '-v2.8 -t epel6', 'python-Jinja2_epel6{0}.spec'),
        ('Jinja2', '-v2.8 -p2 -t mageia', 'python-Jinja2_mageia_py23.spec'),
        ('Jinja2', '-v2.8 -p2 --no-autonc', 'python-Jinja2{0}.spec'),
        ('paperwork-backend', '-v1.2.4', 'python-paperwork-backend.spec'),
        ('Sphinx', '-v1.5 -r python-sphinx -p2', 'python-sphinx_autonc.spec'),
        ('{0}/test_data/utest-0.1.0.tar.gz'.format(tests_dir), '',
         'python-utest.spec'),
        ('{0}/test_data/utest-0.1.0.tar.gz'.format(tests_dir), '-t epel7',
         'python-utest_epel7.spec'),
    ])
    @pytest.mark.webtest
    def test_spec(self, package, options, expected):
        if 'autonc' in expected:
            variant = expected
        else:
            nc = '_dnfnc' if dnf is not None else '_nc'
            variant = expected.format(nc)

        with open(self.td_dir + variant) as fi: