mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-05-18 06:41:43 +02:00
Update tests from dev
This commit is contained in:
parent
6e66b8e08b
commit
fe1ff5c7a3
@ -18,7 +18,9 @@ func TestFind(t *testing.T) {
|
|||||||
|
|
||||||
jobId, cluster, startTime := int64(398998), "fritz", int64(1675957496)
|
jobId, cluster, startTime := int64(398998), "fritz", int64(1675957496)
|
||||||
job, err := r.Find(&jobId, &cluster, &startTime)
|
job, err := r.Find(&jobId, &cluster, &startTime)
|
||||||
noErr(t, err)
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
// fmt.Printf("%+v", job)
|
// fmt.Printf("%+v", job)
|
||||||
|
|
||||||
@ -65,21 +67,7 @@ func TestGetTags(t *testing.T) {
|
|||||||
fmt.Printf("TAGS %+v \n", tags)
|
fmt.Printf("TAGS %+v \n", tags)
|
||||||
// fmt.Printf("COUNTS %+v \n", counts)
|
// fmt.Printf("COUNTS %+v \n", counts)
|
||||||
|
|
||||||
if counts["bandwidth"] != 2 {
|
if counts["bandwidth"] != 0 {
|
||||||
t.Errorf("wrong tag count \ngot: %d \nwant: 2", counts["bandwidth"])
|
t.Errorf("wrong tag count \ngot: %d \nwant: 0", counts["bandwidth"])
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestHasTag(t *testing.T) {
|
|
||||||
r := setup(t)
|
|
||||||
|
|
||||||
if !r.HasTag(5, "util", "bandwidth") {
|
|
||||||
t.Errorf("Expected has tag")
|
|
||||||
}
|
|
||||||
if r.HasTag(4, "patho", "idle") {
|
|
||||||
t.Errorf("Expected has not tag")
|
|
||||||
}
|
|
||||||
if !r.HasTag(5, "patho", "idle") {
|
|
||||||
t.Errorf("Expected has tag")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user