Exemplo n.º 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'
Exemplo 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'
Exemplo n.º 3
0
Arquivo: mybin.py Projeto: xrg/pyp2rpm
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pyp2rpm.bin import main

main()