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

Function TestWithRootNamespaceKeepsConfigOnAccountError

cmd/root_test.go:677–693  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

675}
676
677func TestWithRootNamespaceKeepsConfigOnAccountError(t *testing.T) {
678 cfg := makeDropboxConfig("token", false, "dbmid:member", "api.example.com")
679 stubUsersClient(t, &mockUsersClient{
680 getCurrentAccountFn: func() (*users.FullAccount, error) {
681 return nil, errors.New("account unavailable")
682 },
683 })
684
685 got := withRootNamespace(cfg, tokenPersonal)
686
687 if got.Token != cfg.Token || got.AsMemberID != cfg.AsMemberID || got.Domain != cfg.Domain {
688 t.Fatalf("config = %#v, want original token/as-member/domain", got)
689 }
690 if got.PathRoot != "" {
691 t.Fatalf("path root = %q, want empty on account error", got.PathRoot)
692 }
693}
694
695func TestRootNamespaceID(t *testing.T) {
696 tests := []struct {

Callers

nothing calls this directly

Calls 3

makeDropboxConfigFunction · 0.85
stubUsersClientFunction · 0.85
withRootNamespaceFunction · 0.85

Tested by

no test coverage detected