MCPcopy
hub / github.com/kubernetes/client-go / TestFileLocking

Function TestFileLocking

tools/clientcmd/loader_test.go:563–577  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

561}
562
563func TestFileLocking(t *testing.T) {
564 f, _ := ioutil.TempFile("", "")
565 defer os.Remove(f.Name())
566
567 err := lockFile(f.Name())
568 if err != nil {
569 t.Errorf("unexpected error while locking file: %v", err)
570 }
571 defer unlockFile(f.Name())
572
573 err = lockFile(f.Name())
574 if err == nil {
575 t.Error("expected error while locking file.")
576 }
577}
578
579func Example_noMergingOnExplicitPaths() {
580 commandLineFile, _ := ioutil.TempFile("", "")

Callers

nothing calls this directly

Calls 5

lockFileFunction · 0.85
unlockFileFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.65
NameMethod · 0.45

Tested by

no test coverage detected