17 lines
497 B
Go
17 lines
497 B
Go
package app
|
|
|
|
import "testing"
|
|
|
|
func TestEarlyFrontendCallsAreSafeBeforeSchedulerReady(t *testing.T) {
|
|
app := &App{}
|
|
if got := app.GetAccounts(); len(got) != 0 {
|
|
t.Fatalf("GetAccounts()=%v, want empty before scheduler init", got)
|
|
}
|
|
if got := app.GetSeckillStatus(); got.Success {
|
|
t.Fatal("GetSeckillStatus() should report not running before scheduler init")
|
|
}
|
|
if got := app.GetTime(); got.Source != "localFallback" {
|
|
t.Fatalf("GetTime().Source=%q, want localFallback", got.Source)
|
|
}
|
|
}
|