shirou_gopsutil/host_test.go

26 lines
381 B
Go
Raw Normal View History

2014-04-22 08:44:22 +08:00
package gopsutil
2014-04-18 15:34:47 +08:00
import (
"testing"
)
func TestHostInfo(t *testing.T) {
v, err := HostInfo()
2014-04-18 15:34:47 +08:00
if err != nil {
t.Errorf("error %v", err)
}
if v.Hostname == "" {
t.Errorf("Could not get hostinfo %v", v)
}
}
func TestBoot_time(t *testing.T) {
v, err := Boot_time()
if err != nil {
t.Errorf("error %v", err)
}
if v == 0 {
t.Errorf("Could not boot time %v", v)
2014-04-18 15:34:47 +08:00
}
}