mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-01 06:10:17 +00:00
Use framework.ExpectEqual() in unit test
Signed-off-by: clarklee92 <clarklee1992@hotmail.com>
This commit is contained in:
@@ -21,6 +21,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/onsi/gomega"
|
||||
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
)
|
||||
|
||||
var currentTime time.Time
|
||||
@@ -64,9 +66,9 @@ func TestTimer(t *testing.T) {
|
||||
}
|
||||
]
|
||||
}`))
|
||||
gomega.Expect(timer.PrintHumanReadable()).To(gomega.Equal(`Phase 001-one: 5.5s so far
|
||||
framework.ExpectEqual(timer.PrintHumanReadable(), `Phase 001-one: 5.5s so far
|
||||
Phase 033-two: 3.5s
|
||||
`))
|
||||
`)
|
||||
|
||||
setCurrentTimeSinceEpoch(7*time.Second + 500*time.Millisecond)
|
||||
phaseOne.End()
|
||||
@@ -86,7 +88,7 @@ Phase 033-two: 3.5s
|
||||
}
|
||||
]
|
||||
}`))
|
||||
gomega.Expect(timer.PrintHumanReadable()).To(gomega.Equal(`Phase 001-one: 6.5s
|
||||
framework.ExpectEqual(timer.PrintHumanReadable(), `Phase 001-one: 6.5s
|
||||
Phase 033-two: 3.5s
|
||||
`))
|
||||
`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user