def test_download_rosdep_data(): from rosdep2.sources_list import download_rosdep_data from rosdep2 import DownloadFailure url = GITHUB_BASE_URL data = download_rosdep_data(url) assert 'boost' in data #sanity check # try with a bad URL try: data = download_rosdep_data('http://badhost.willowgarage.com/rosdep.yaml') assert False, "should have raised" except DownloadFailure as e: pass # try to trigger both non-dict clause and YAMLError clause for url in [ 'https://code.ros.org/svn/release/trunk/distros/', 'https://code.ros.org/svn/release/trunk/distros/manifest.xml', ]: try: data = download_rosdep_data(url) assert False, "should have raised" except DownloadFailure as e: pass
def test_download_rosdep_data(): from rosdep2.sources_list import download_rosdep_data from rosdep2 import DownloadFailure url = GITHUB_BASE_URL data = download_rosdep_data(url) assert 'boost' in data # sanity check # try with a bad URL try: data = download_rosdep_data('http://badhost.willowgarage.com/rosdep.yaml') assert False, 'should have raised' except DownloadFailure as e: pass # try to trigger both non-dict clause and YAMLError clause for url in [ 'https://code.ros.org/svn/release/trunk/distros/', 'https://code.ros.org/svn/release/trunk/distros/manifest.xml', ]: try: data = download_rosdep_data(url) assert False, 'should have raised' except DownloadFailure as e: pass