@@ -79,12 +79,16 @@ func TestDaemonBundleLibInstall(t *testing.T) {
79
79
}
80
80
81
81
// Check if libraries are installed as expected
82
+ installedEthernetVersion := ""
82
83
{
83
84
resp , err := grpcInst .LibraryList (context .Background (), "" , "" , true , false )
84
85
require .NoError (t , err )
85
86
libsAndLocation := map [string ]commands.LibraryLocation {}
86
87
for _ , lib := range resp .GetInstalledLibraries () {
87
88
libsAndLocation [lib .Library .Name ] = lib .Library .Location
89
+ if lib .Library .Name == "Ethernet" {
90
+ installedEthernetVersion = lib .Library .Version
91
+ }
88
92
}
89
93
require .Contains (t , libsAndLocation , "Ethernet" )
90
94
require .Contains (t , libsAndLocation , "SD" )
@@ -94,6 +98,36 @@ func TestDaemonBundleLibInstall(t *testing.T) {
94
98
require .Equal (t , libsAndLocation ["Firmata" ], commands .LibraryLocation_LIBRARY_LOCATION_BUILTIN )
95
99
}
96
100
101
+ // Remove library from sketchbook
102
+ {
103
+ uninstCl , err := grpcInst .LibraryUninstall (context .Background (), "Ethernet" , installedEthernetVersion )
104
+ require .NoError (t , err )
105
+ for {
106
+ msg , err := uninstCl .Recv ()
107
+ if err == io .EOF {
108
+ break
109
+ }
110
+ require .NoError (t , err )
111
+ fmt .Printf ("LIB INSTALL> %+v\n " , msg )
112
+ }
113
+ }
114
+
115
+ // Check if libraries are installed as expected
116
+ {
117
+ resp , err := grpcInst .LibraryList (context .Background (), "" , "" , true , false )
118
+ require .NoError (t , err )
119
+ libsAndLocation := map [string ]commands.LibraryLocation {}
120
+ for _ , lib := range resp .GetInstalledLibraries () {
121
+ libsAndLocation [lib .Library .Name ] = lib .Library .Location
122
+ }
123
+ require .Contains (t , libsAndLocation , "Ethernet" )
124
+ require .Contains (t , libsAndLocation , "SD" )
125
+ require .Contains (t , libsAndLocation , "Firmata" )
126
+ require .Equal (t , libsAndLocation ["Ethernet" ], commands .LibraryLocation_LIBRARY_LOCATION_BUILTIN )
127
+ require .Equal (t , libsAndLocation ["SD" ], commands .LibraryLocation_LIBRARY_LOCATION_BUILTIN )
128
+ require .Equal (t , libsAndLocation ["Firmata" ], commands .LibraryLocation_LIBRARY_LOCATION_BUILTIN )
129
+ }
130
+
97
131
// Un-Set builtin libraries dir
98
132
err := cli .SetValue ("directories.builtin.libraries" , `""` )
99
133
require .NoError (t , err )
0 commit comments