(t *testing.T)
| 675 | } |
| 676 | |
| 677 | func 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 | |
| 695 | func TestRootNamespaceID(t *testing.T) { |
| 696 | tests := []struct { |
nothing calls this directly
no test coverage detected