@@ -16,7 +16,7 @@ import (
16
16
)
17
17
18
18
func TestEnableToolsEmpty (t * testing.T ) {
19
- ctx , _ , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
19
+ ctx , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
20
20
21
21
err := Enable (ctx , docker , []string {"search_duckduckgo" }, "duckduckgo" )
22
22
require .NoError (t , err )
@@ -30,7 +30,7 @@ func TestEnableToolsEmpty(t *testing.T) {
30
30
}
31
31
32
32
func TestEnableToolsExistingServer (t * testing.T ) {
33
- ctx , _ , docker := setup (t ,
33
+ ctx , docker := setup (t ,
34
34
withToolsConfig ("duckduckgo:\n - other_tool" ),
35
35
withSampleCatalog ())
36
36
@@ -47,7 +47,7 @@ func TestEnableToolsExistingServer(t *testing.T) {
47
47
}
48
48
49
49
func TestEnableToolsExistingTool (t * testing.T ) {
50
- ctx , _ , docker := setup (t ,
50
+ ctx , docker := setup (t ,
51
51
withToolsConfig ("duckduckgo:\n - other_tool" ),
52
52
withSampleCatalog ())
53
53
@@ -64,7 +64,7 @@ func TestEnableToolsExistingTool(t *testing.T) {
64
64
}
65
65
66
66
func TestEnableToolsDuplicateTool (t * testing.T ) {
67
- ctx , _ , docker := setup (t ,
67
+ ctx , docker := setup (t ,
68
68
withEmptyToolsConfig (),
69
69
withSampleCatalog ())
70
70
@@ -92,21 +92,21 @@ func TestEnableToolsDuplicateTool(t *testing.T) {
92
92
}
93
93
94
94
func TestEnableToolNotFound (t * testing.T ) {
95
- ctx , _ , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
95
+ ctx , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
96
96
97
97
err := Enable (ctx , docker , []string {"nonexistent_tool" }, "duckduckgo" )
98
98
require .ErrorContains (t , err , "tool \" nonexistent_tool\" not found in server \" duckduckgo\" " )
99
99
}
100
100
101
101
func TestEnableServerNotFound (t * testing.T ) {
102
- ctx , _ , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
102
+ ctx , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
103
103
104
104
err := Enable (ctx , docker , []string {"nonexistent_tool" }, "nonexistent_server" )
105
105
require .ErrorContains (t , err , "server \" nonexistent_server\" not found in catalog" )
106
106
}
107
107
108
108
func TestEnableToolAutoDiscoverServer (t * testing.T ) {
109
- ctx , _ , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
109
+ ctx , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
110
110
111
111
err := Enable (ctx , docker , []string {"search_duckduckgo" }, "" )
112
112
require .NoError (t , err )
@@ -120,7 +120,7 @@ func TestEnableToolAutoDiscoverServer(t *testing.T) {
120
120
}
121
121
122
122
func TestEnableToolAutoDiscoverServerExistingServer (t * testing.T ) {
123
- ctx , _ , docker := setup (t , withToolsConfig ("duckduckgo:\n - other_tool" ), withSampleCatalog ())
123
+ ctx , docker := setup (t , withToolsConfig ("duckduckgo:\n - other_tool" ), withSampleCatalog ())
124
124
125
125
err := Enable (ctx , docker , []string {"search_duckduckgo" }, "" )
126
126
require .NoError (t , err )
@@ -135,7 +135,7 @@ func TestEnableToolAutoDiscoverServerExistingServer(t *testing.T) {
135
135
}
136
136
137
137
func TestEnableToolAutoDiscoverServerExistingTool (t * testing.T ) {
138
- ctx , _ , docker := setup (t ,
138
+ ctx , docker := setup (t ,
139
139
withToolsConfig ("duckduckgo:\n - other_tool" ),
140
140
withSampleCatalog ())
141
141
@@ -152,14 +152,14 @@ func TestEnableToolAutoDiscoverServerExistingTool(t *testing.T) {
152
152
}
153
153
154
154
func TestEnableToolAutoDiscoverNotFound (t * testing.T ) {
155
- ctx , _ , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
155
+ ctx , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
156
156
157
157
err := Enable (ctx , docker , []string {"nonexistent_tool" }, "" )
158
158
require .ErrorContains (t , err , "tool \" nonexistent_tool\" not found in any server" )
159
159
}
160
160
161
161
func TestEnableMultipleTools (t * testing.T ) {
162
- ctx , _ , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
162
+ ctx , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
163
163
164
164
err := Enable (ctx , docker , []string {"search_duckduckgo" , "other_tool" }, "duckduckgo" )
165
165
require .NoError (t , err )
@@ -175,7 +175,7 @@ func TestEnableMultipleTools(t *testing.T) {
175
175
}
176
176
177
177
func TestDisableEmpty (t * testing.T ) {
178
- ctx , _ , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
178
+ ctx , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
179
179
180
180
err := Disable (ctx , docker , []string {"search_duckduckgo" }, "duckduckgo" )
181
181
require .NoError (t , err )
@@ -190,7 +190,7 @@ func TestDisableEmpty(t *testing.T) {
190
190
}
191
191
192
192
func TestDisableToolExistingServer (t * testing.T ) {
193
- ctx , _ , docker := setup (t ,
193
+ ctx , docker := setup (t ,
194
194
withToolsConfig ("duckduckgo:\n - search_duckduckgo\n - other_tool" ),
195
195
withSampleCatalog ())
196
196
@@ -207,7 +207,7 @@ func TestDisableToolExistingServer(t *testing.T) {
207
207
}
208
208
209
209
func TestDisableToolExistingServerToolAlreadyDisabled (t * testing.T ) {
210
- ctx , _ , docker := setup (t ,
210
+ ctx , docker := setup (t ,
211
211
withToolsConfig ("duckduckgo:\n - search_duckduckgo" ),
212
212
withSampleCatalog ())
213
213
@@ -224,14 +224,14 @@ func TestDisableToolExistingServerToolAlreadyDisabled(t *testing.T) {
224
224
}
225
225
226
226
func TestDisableServerNotFound (t * testing.T ) {
227
- ctx , _ , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
227
+ ctx , docker := setup (t , withEmptyToolsConfig (), withSampleCatalog ())
228
228
229
229
err := Disable (ctx , docker , []string {"nonexistent_tool" }, "nonexistent_server" )
230
230
require .ErrorContains (t , err , "server \" nonexistent_server\" not found in catalog" )
231
231
}
232
232
233
233
func TestDisableMultipleTools (t * testing.T ) {
234
- ctx , _ , docker := setup (t ,
234
+ ctx , docker := setup (t ,
235
235
withToolsConfig ("duckduckgo:\n - search_duckduckgo\n - other_tool" ),
236
236
withSampleCatalog ())
237
237
@@ -250,7 +250,7 @@ func TestDisableMultipleTools(t *testing.T) {
250
250
251
251
// Fixtures and helpers
252
252
253
- func setup (t * testing.T , options ... option ) (context.Context , string , docker.Client ) {
253
+ func setup (t * testing.T , options ... option ) (context.Context , docker.Client ) {
254
254
t .Helper ()
255
255
256
256
docker := & fakeDocker {}
@@ -266,7 +266,7 @@ func setup(t *testing.T, options ...option) (context.Context, string, docker.Cli
266
266
o (t , home , docker )
267
267
}
268
268
269
- return t .Context (), home , docker
269
+ return t .Context (), docker
270
270
}
271
271
272
272
func writeFile (t * testing.T , path string , content []byte ) {
0 commit comments