# 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
        (['--list-file=file_name'], {'list_file': 'file_name'}),
    ])
    def test_scl_convertor_args_correctly_passed(self, options,
                                                 expected_options, capsys):
        """Test that pyp2rpm command passes correct options to
        SCL convertor.
        """
        self.default_options.update(expected_options)
        flexmock(SclConvertor).should_receive('convert').and_return(
            self.test_spec)
        flexmock(SclConvertor).should_receive('__init__').with_args(
            options=self.default_options,
        ).once()

        with pytest.raises(SystemExit):
            main(args=['foo_package', '--sclize'] + options)
        out, err = capsys.readouterr()
        assert out == self.test_spec + '\n'

    @pytest.mark.parametrize(('options', 'omit_from_spec'), [
        ({'no_meta_runtime_dep': True}, '%{?scl:Requires: %{scl}-runtime}'),
        ({'no_meta_buildtime_dep': True},
         '{?scl:BuildRequires: %{scl}-runtime}'),
        ({'skip_functions': 'handle_python_specific_commands'},
         '%{?scl:scl enable %{scl} - << \\EOF}\nset -e\nsphinx-build doc html\n%{?scl:EOF}'),
    ])
    def test_convert_to_scl_options(self, options, omit_from_spec):
        """Test integration with SCL options."""
        self.default_options.update({'skip_functions': ''})
        self.default_options.update(options)

# 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

        (['--list-file=file_name'], {'list_file': 'file_name'}),
    ])
    def test_scl_convertor_args_correctly_passed(self, options,
                                                 expected_options, capsys):
        """Test that pyp2rpm command passes correct options to
        SCL convertor.
        """
        self.default_options.update(expected_options)
        flexmock(SclConvertor).should_receive('convert').and_return(
            self.test_spec)
        flexmock(SclConvertor).should_receive('__init__').with_args(
            options=self.default_options,
        ).once()

        with pytest.raises(SystemExit):
            main(args=['foo_package', '--sclize'] + options)
        out, err = capsys.readouterr()
        assert out == self.test_spec + '\n'

    @pytest.mark.parametrize(('options', 'omit_from_spec'), [
        ({'no_meta_runtime_dep': True}, '%{?scl:Requires: %{scl}-runtime}'),
        ({'no_meta_buildtime_dep': True},
         '{?scl:BuildRequires: %{scl}-runtime}'),
        ({'skip_functions': 'handle_python_specific_commands'},
         '%{?scl:scl enable %{scl} - << \\EOF}\nset -e\nsphinx-build doc html\n%{?scl:EOF}'),
    ])
    def test_convert_to_scl_options(self, options, omit_from_spec):
        """Test integration with SCL options."""
        self.default_options.update({'skip_functions': ''})
        self.default_options.update(options)

        converted = convert_to_scl(self.test_spec, self.default_options)