示例#1
0
    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(
            spec=self.test_spec,
            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'
示例#2
0
    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'
示例#3
0
文件: mybin.py 项目: xrg/pyp2rpm
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pyp2rpm.bin import main

main()