Files
nomad/api/allocs_test.go
2015-09-08 16:45:16 -07:00

24 lines
415 B
Go

package api
import (
"testing"
)
func TestAllocs_List(t *testing.T) {
c, s := makeClient(t, nil, nil)
defer s.Stop()
a := c.Allocs()
// Querying when no allocs exist returns nothing
allocs, qm, err := a.List()
if err != nil {
t.Fatalf("err: %s", err)
}
if qm.LastIndex != 0 {
t.Fatalf("bad index: %d", qm.LastIndex)
}
if n := len(allocs); n != 0 {
t.Fatalf("expected 0 allocs, got: %d", n)
}
}