def test_SourceInstaller_get_install_command(): from rosdep2.platforms.source import SourceInstaller, SourceInstall installer = SourceInstaller() resolved = SourceInstall() resolved.manifest_url = 'http://fake/foo' resolved.check_presence_command = """#!/bin/bash exit 1 """ commands = installer.get_install_command([resolved]) assert len(commands) == 1 assert commands[0] == ['rosdep-source', 'install', 'http://fake/foo'] resolved = SourceInstall() resolved.manifest_url = 'http://fake/foo' resolved.check_presence_command = """#!/bin/bash exit 0 """ commands = installer.get_install_command([resolved]) assert not(commands)
def test_SourceInstaller_get_install_command(): from rosdep2.platforms.source import SourceInstaller, SourceInstall installer = SourceInstaller() resolved = SourceInstall() resolved.manifest_url = 'http://fake/foo' resolved.check_presence_command = """#!/bin/bash exit 1 """ commands = installer.get_install_command([resolved]) assert len(commands) == 1 assert commands[0] == ['rosdep-source', 'install', 'http://fake/foo'] resolved = SourceInstall() resolved.manifest_url = 'http://fake/foo' resolved.check_presence_command = """#!/bin/bash exit 0 """ commands = installer.get_install_command([resolved]) assert not (commands)