MCPcopy Create free account
hub / github.com/aws/aws-node-termination-handler / TestUptimeFromFileSuccess

Function TestUptimeFromFileSuccess

pkg/uptime/common_test.go:25–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23const testFile = "test.out"
24
25func TestUptimeFromFileSuccess(t *testing.T) {
26 d1 := []byte("350735.47 234388.90")
27 err := os.WriteFile(testFile, d1, 0644)
28 h.Ok(t, err)
29
30 value, err := UptimeFromFile(testFile)
31 _ = os.Remove(testFile)
32 h.Ok(t, err)
33 h.Equals(t, int64(350735), value)
34}
35
36func TestUptimeFromFileReadFail(t *testing.T) {
37 _, err := UptimeFromFile("does-not-exist")

Callers

nothing calls this directly

Calls 1

UptimeFromFileFunction · 0.85

Tested by

no test coverage detected