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

Function TestDuTextUsesCommandOutput

cmd/du_test.go:16–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestDuTextUsesCommandOutput(t *testing.T) {
17 cmd, stdout := testDuCmd()
18 stubUsersClient(t, &mockUsersClient{
19 getSpaceUsageFn: func() (*users.SpaceUsage, error) {
20 return individualSpaceUsage(), nil
21 },
22 })
23
24 if err := du(cmd, nil); err != nil {
25 t.Fatalf("du returned error: %v", err)
26 }
27 output := stdout.String()
28 for _, want := range []string{
29 "Used: 1.0 KiB",
30 "Type: individual",
31 "Allocated: 2.0 KiB",
32 } {
33 if !strings.Contains(output, want) {
34 t.Fatalf("stdout = %q, want %q", output, want)
35 }
36 }
37}
38
39func TestDuJSONIndividualAllocation(t *testing.T) {
40 cmd, stdout := testDuCmd()

Callers

nothing calls this directly

Calls 4

testDuCmdFunction · 0.85
stubUsersClientFunction · 0.85
individualSpaceUsageFunction · 0.85
duFunction · 0.85

Tested by

no test coverage detected