@@ -540,3 +540,58 @@ def test_install_with_git_url_does_not_create_git_repo(run_command, downloads_di
540
540
541
541
# Verifies installed library is not a git repository
542
542
assert not Path (lib_install_dir , ".git" ).exists ()
543
+
544
+
545
+ def test_install_with_git_url_multiple_libraries (run_command , downloads_dir , data_dir ):
546
+ assert run_command ("update" )
547
+
548
+ env = {
549
+ "ARDUINO_DATA_DIR" : data_dir ,
550
+ "ARDUINO_DOWNLOADS_DIR" : downloads_dir ,
551
+ "ARDUINO_SKETCHBOOK_DIR" : data_dir ,
552
+ "ARDUINO_ENABLE_UNSAFE_LIBRARY_INSTALL" : "true" ,
553
+ }
554
+
555
+ wifi_install_dir = Path (data_dir , "libraries" , "WiFi101" )
556
+ ble_install_dir = Path (data_dir , "libraries" , "ArduinoBLE" )
557
+ # Verifies libraries are not installed
558
+ assert not wifi_install_dir .exists ()
559
+ assert not ble_install_dir .exists ()
560
+
561
+ wifi_url = "https://github.com/arduino-libraries/WiFi101.git"
562
+ ble_url = "https://github.com/arduino-libraries/ArduinoBLE.git"
563
+
564
+ assert run_command (f"lib install --git-url { wifi_url } { ble_url } " , custom_env = env )
565
+
566
+ # Verifies library are installed
567
+ assert wifi_install_dir .exists ()
568
+ assert ble_install_dir .exists ()
569
+
570
+
571
+ def test_install_with_zip_path_multiple_libraries (run_command , downloads_dir , data_dir ):
572
+ assert run_command ("update" )
573
+
574
+ env = {
575
+ "ARDUINO_DATA_DIR" : data_dir ,
576
+ "ARDUINO_DOWNLOADS_DIR" : downloads_dir ,
577
+ "ARDUINO_SKETCHBOOK_DIR" : data_dir ,
578
+ "ARDUINO_ENABLE_UNSAFE_LIBRARY_INSTALL" : "true" ,
579
+ }
580
+
581
+ # Downloads zip to be installed later
582
+ assert run_command (
"lib download [email protected] " )
583
+ assert run_command (
"lib download [email protected] " )
584
+ wifi_zip_path = Path (downloads_dir , "libraries" , "WiFi101-0.16.1.zip" )
585
+ ble_zip_path = Path (downloads_dir , "libraries" , "ArduinoBLE-1.1.3.zip" )
586
+
587
+ wifi_install_dir = Path (data_dir , "libraries" , "WiFi101-0.16.1" )
588
+ ble_install_dir = Path (data_dir , "libraries" , "ArduinoBLE-1.1.3" )
589
+ # Verifies libraries are not installed
590
+ assert not wifi_install_dir .exists ()
591
+ assert not ble_install_dir .exists ()
592
+
593
+ assert run_command (f"lib install --zip-path { wifi_zip_path } { ble_zip_path } " , custom_env = env )
594
+
595
+ # Verifies library are installed
596
+ assert wifi_install_dir .exists ()
597
+ assert ble_install_dir .exists ()
0 commit comments