MCPcopy
hub / github.com/prometheus/node_exporter / TestCustomSysPath

Function TestCustomSysPath

collector/paths_test.go:65–77  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestCustomSysPath(t *testing.T) {
66 if _, err := kingpin.CommandLine.Parse([]string{"--path.sysfs", "./../some/./place/"}); err != nil {
67 t.Fatal(err)
68 }
69
70 if got, want := sysFilePath("somefile"), "../some/place/somefile"; got != want {
71 t.Errorf("Expected: %s, Got: %s", want, got)
72 }
73
74 if got, want := sysFilePath("some/file"), "../some/place/some/file"; got != want {
75 t.Errorf("Expected: %s, Got: %s", want, got)
76 }
77}

Callers

nothing calls this directly

Calls 1

sysFilePathFunction · 0.85

Tested by

no test coverage detected