def test_AptInstaller():
    from rosdep2.platforms.debian import AptInstaller

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

        mock_method.return_value = ['a', 'b']
        expected = [['sudo', '-H', 'apt-get', 'install', '-y', 'a'],
                    ['sudo', '-H', 'apt-get', 'install', '-y', 'b']]
        val = installer.get_install_command(['whatever'], interactive=False)
        print("VAL", val)
        assert val == expected, val
        expected = [['sudo', '-H', 'apt-get', 'install', 'a'],
                    ['sudo', '-H', 'apt-get', 'install', 'b']]
        val = installer.get_install_command(['whatever'], interactive=True)
        assert val == expected, val
    try:
        test()
    except __HOLE__:
        traceback.print_exc()
        raise
dataset/ETHPy150Open ros-infrastructure/rosdep/test/test_rosdep_debian.py/test_AptInstaller