MCPcopy Create free account
hub / github.com/dropbox/dbxcli / TestSharedLinkCreateRejectsRootPath

Function TestSharedLinkCreateRejectsRootPath

cmd/share_create_link_test.go:170–186  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

168}
169
170func TestSharedLinkCreateRejectsRootPath(t *testing.T) {
171 called := false
172 stubSharedLinkClient(t, &mockSharedLinkClient{
173 createSharedLinkWithSettingsFn: func(arg *sharing.CreateSharedLinkWithSettingsArg) (sharing.IsSharedLinkMetadata, error) {
174 called = true
175 return nil, nil
176 },
177 })
178
179 err := shareLinkCreate(&cobra.Command{}, []string{"/"})
180 if err == nil || !strings.Contains(err.Error(), "cannot create a shared link for Dropbox root") {
181 t.Fatalf("error = %v, want root path error", err)
182 }
183 if called {
184 t.Fatal("CreateSharedLinkWithSettings should not be called")
185 }
186}
187
188func TestSharedLinkCreatePrintsURLAndUsesDefaultSettings(t *testing.T) {
189 mock := &mockSharedLinkClient{

Callers

nothing calls this directly

Calls 3

stubSharedLinkClientFunction · 0.85
shareLinkCreateFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected