mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 00:45:43 +03:00
24 lines
415 B
Go
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)
|
|
}
|
|
}
|