def rpi(self, *parameters): '''Setup cross compiler tools for Raspberry Pi (must be linux)''' parser = argparse.ArgumentParser(description=self.rpi.__doc__, prog="bii %s:rpi" % self.group) parser.add_argument("-i", "--interactive", default=False, action='store_true', help='Runs in interactive mode, can require user input') args = parser.parse_args(*parameters) if not OSInfo.is_linux(): raise BiiException('You need to use a linux OS') # If we are installing c++ cross compiler... we need the other c++ tools install_gnu_arm(self.bii.user_io) self._setup_cpp(args.interactive)
def test_install_gnu_arm(self, mkdir, lin32, mock_decompress, mock_download, finder, os_info): ui = Mock(UserIO) os_info.return_value = True mock_download.return_value = 'downloaded_file' self.assertEqual(('/usr/bin/gcc', '/usr/bin/gcc'), install_gnu_arm(ui)) self.assertTrue(mock_download.called) self.assertTrue(mock_decompress.called) self.assertTrue(lin32.called)
def rpi(self, *parameters): '''Setup cross compiler tools for Raspberry Pi (must be linux)''' parser = argparse.ArgumentParser(description=self.rpi.__doc__, prog="bii %s:rpi" % self.group) parser.add_argument( "-i", "--interactive", default=False, action='store_true', help='Runs in interactive mode, can require user input') args = parser.parse_args(*parameters) if not OSInfo.is_linux(): raise BiiException('You need to use a linux OS') # If we are installing c++ cross compiler... we need the other c++ tools install_gnu_arm(self.bii.user_io) self._setup_cpp(args.interactive)
def test_install_gnu_arm_already_installed(self, lin32, download, finder, os_info): ui = Mock(UserIO) os_info.return_value = True finder.return_value = ('/usr/bin/gcc', '/usr/bin/gcc') install_gnu_arm(ui) self.assertFalse(download.called)
def test_install_gnu_arm_non_linux(self, os_info): os_info.return_value = False ui = Mock(UserIO) with self.assertRaises(ClientException): install_gnu_arm(ui)