pull/1725/merge
Sven Nierlein 2 months ago committed by GitHub
commit 1599f22d72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -3,6 +3,7 @@
package sensors package sensors
import ( import (
"context"
"fmt" "fmt"
"testing" "testing"
) )
@ -19,3 +20,25 @@ func TestTemperatureStat_String(t *testing.T) {
t.Errorf("TemperatureStat string is invalid, %v", fmt.Sprintf("%v", v)) t.Errorf("TemperatureStat string is invalid, %v", fmt.Sprintf("%v", v))
} }
} }
func skipIfNotImplementedErr(t *testing.T, err error) {
if errors.Is(err, common.ErrNotImplementedError) {
t.Skip("not implemented")
}
}
func TestTemperatures(t *testing.T) {
if os.Getenv("CI") != "" {
t.Skip("Skip CI")
}
v, err := SensorsTemperatures()
skipIfNotImplementedErr(t, err)
if err != nil {
t.Errorf("error %v", err)
}
if len(v) == 0 {
t.Errorf("Could not get temperature %v", v)
}
t.Log(v)
}

Loading…
Cancel
Save