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

Function TestRootNamespaceID

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

Source from the content-addressed store, hash-verified

693}
694
695func TestRootNamespaceID(t *testing.T) {
696 tests := []struct {
697 name string
698 account *users.FullAccount
699 want string
700 }{
701 {
702 name: "team root",
703 account: testRootFullAccount(common.NewTeamRootInfo("team-root", "home-ns", "/Member")),
704 want: "team-root",
705 },
706 {
707 name: "user root",
708 account: testRootFullAccount(common.NewUserRootInfo("user-root", "home-ns")),
709 want: "user-root",
710 },
711 {
712 name: "nil account",
713 account: nil,
714 want: "",
715 },
716 {
717 name: "nil root info",
718 account: testRootFullAccount(nil),
719 want: "",
720 },
721 }
722
723 for _, tt := range tests {
724 t.Run(tt.name, func(t *testing.T) {
725 if got := rootNamespaceID(tt.account); got != tt.want {
726 t.Fatalf("root namespace ID = %q, want %q", got, tt.want)
727 }
728 })
729 }
730}
731
732func testRootFullAccount(rootInfo common.IsRootInfo) *users.FullAccount {
733 return users.NewFullAccount(

Callers

nothing calls this directly

Calls 2

testRootFullAccountFunction · 0.85
rootNamespaceIDFunction · 0.85

Tested by

no test coverage detected