stat_test.go 286 B

1234567891011121314151617181920
  1. package cpu
  2. import (
  3. "testing"
  4. "time"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func TestStat(t *testing.T) {
  8. time.Sleep(time.Second * 2)
  9. var s Stat
  10. var i Info
  11. ReadStat(&s)
  12. i = GetInfo()
  13. assert.NotZero(t, s.Usage)
  14. assert.NotZero(t, i.Frequency)
  15. assert.NotZero(t, i.Quota)
  16. }