open-nomad/api/util_test.go
Chris Hines 33f4afe05e Remove clock granularity sensitive test assertion.
TestRequestTime already verifies that the request time is properly recorded.
2015-12-14 17:03:08 -05:00

35 lines
617 B
Go

package api
import (
"testing"
)
func assertQueryMeta(t *testing.T, qm *QueryMeta) {
if qm.LastIndex == 0 {
t.Fatalf("bad index: %d", qm.LastIndex)
}
if !qm.KnownLeader {
t.Fatalf("expected known leader, got none")
}
}
func assertWriteMeta(t *testing.T, wm *WriteMeta) {
if wm.LastIndex == 0 {
t.Fatalf("bad index: %d", wm.LastIndex)
}
}
func testJob() *Job {
task := NewTask("task1", "exec").
Require(&Resources{MemoryMB: 256})
group := NewTaskGroup("group1", 1).
AddTask(task)
job := NewBatchJob("job1", "redis", "region1", 1).
AddDatacenter("dc1").
AddTaskGroup(group)
return job
}