MCPcopy Create free account
hub / github.com/evilsocket/sum / TestLoaderListPathWithError

Function TestLoaderListPathWithError

storage/loader_test.go:100–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

98}
99
100func TestLoaderListPathWithError(t *testing.T) {
101 if _, _, err := ListPath("/dev/random"); err == nil {
102 t.Fatal("expected an error")
103 } else if _, _, err := ListPath("/lulzlulz"); err == nil {
104 t.Fatal("expected an error")
105 } else if !canWriteOnRoot() {
106 // on docker this check is skipped
107 if _, _, err := ListPath("/root"); err == nil {
108 t.Fatal("expected permission denied")
109 }
110 }
111}
112
113func TestLoaderLoad(t *testing.T) {
114 setupRawRecords(t)

Callers

nothing calls this directly

Calls 2

ListPathFunction · 0.85
canWriteOnRootFunction · 0.85

Tested by

no test coverage detected