github.com/mackerelio/mackerel-agent-plugins@v0.89.3/mackerel-plugin-unicorn/lib/unicorn_test.go (about) 1 package mpunicorn 2 3 import "testing" 4 5 func TestFetchMetrics(t *testing.T) { 6 var unicorn UnicornPlugin 7 8 stat, _ := unicorn.FetchMetrics() 9 if len(stat) != 5 { 10 t.Errorf("GetStat: %d should be 5", len(stat)) 11 } 12 } 13 14 func TestGraphDefinition(t *testing.T) { 15 var unicorn UnicornPlugin 16 17 graphdef := unicorn.GraphDefinition() 18 if len(graphdef) != 2 { 19 t.Errorf("GetTempfilename: %d should be 2", len(graphdef)) 20 } 21 }