• Cristian Maglie's avatar
    Added tests for invalid 3rd-party URL · 917b9e25
    Cristian Maglie authored
    as explained in #81:
    
      It says all packages were downloaded:
    
        Updating index: package_index.json downloaded
        Updating index: package_esp8266com_index.json downloaded
        Updating index: package_lalala_index.json downloaded
    
      But when you run commands like arduino-cli core list or arduino-cli board listall it exits with an error:
    
        Error: loading json index file /Users/MY_USER_NAME/arduino-cli/data/package_lalala_index.json: invalid character '<' looking for beginning of value
        Failed to load http://google.com/package_lalala_index.json package index.
        Try updating all indexes with `arduino-cli core update-index`.
    
      It occurs, because package_lalala_index.json contains 404 HTML page.
    917b9e25
commands_test.go 19.5 KB