def test_YumInstaller():
    from rosdep2.platforms.redhat import YumInstaller

    @patch.object(YumInstaller, 'get_packages_to_install')
    def test(mock_method):
        installer = YumInstaller()
        mock_method.return_value = []
        assert [] == installer.get_install_command(['fake'])

        # no interactive option with YUM
        mock_method.return_value = ['a', 'b']
        expected = [['sudo', '-H', 'yum', '--assumeyes', '--quiet', '--skip-broken', 'install', 'a', 'b']]
        val = installer.get_install_command(['whatever'], interactive=False, quiet=True)
        assert val == expected, val + expected
        expected = [['sudo', '-H', 'yum', '--quiet', '--skip-broken', 'install', 'a', 'b']]
        val = installer.get_install_command(['whatever'], interactive=True, quiet=True)
        assert val == expected, val + expected
        expected = [['sudo', '-H', 'yum', '--assumeyes', '--skip-broken', 'install', 'a', 'b']]
        val = installer.get_install_command(['whatever'], interactive=False, quiet=False)
        assert val == expected, val + expected
        expected = [['sudo', '-H', 'yum', '--skip-broken', 'install', 'a', 'b']]
        val = installer.get_install_command(['whatever'], interactive=True, quiet=False)
        assert val == expected, val + expected
    try:
        test()
    except __HOLE__:
        traceback.print_exc()
        raise
dataset/ETHPy150Open ros-infrastructure/rosdep/test/test_rosdep_redhat.py/test_YumInstaller