Add test items for job utils

This commit is contained in:
zhangxiaoyu-zidif 2017-07-29 16:06:48 +08:00
parent 6fbc554c6b
commit a0eb194d81

View File

@ -46,4 +46,21 @@ func TestIsJobFinished(t *testing.T) {
if IsJobFinished(job) {
t.Error("Job was not expected to be finished")
}
job.Status.Conditions[0].Type = batch.JobFailed
job.Status.Conditions[0].Status = v1.ConditionTrue
if !IsJobFinished(job) {
t.Error("Job was expected to be finished")
}
job.Status.Conditions[0].Status = v1.ConditionFalse
if IsJobFinished(job) {
t.Error("Job was not expected to be finished")
}
job.Status.Conditions[0].Status = v1.ConditionUnknown
if IsJobFinished(job) {
t.Error("Job was not expected to be finished")
}
}