OLD | NEW |
1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
4 | 4 |
5 package memory | 5 package memory |
6 | 6 |
7 import ( | 7 import ( |
8 "fmt" | 8 "fmt" |
9 "math/rand" | 9 "math/rand" |
10 "net/http" | 10 "net/http" |
11 "testing" | 11 "testing" |
12 "time" | 12 "time" |
13 | 13 |
14 dsS "github.com/luci/gae/service/datastore" | 14 dsS "github.com/luci/gae/service/datastore" |
15 "github.com/luci/gae/service/info" | 15 "github.com/luci/gae/service/info" |
16 tqS "github.com/luci/gae/service/taskqueue" | 16 tqS "github.com/luci/gae/service/taskqueue" |
17 "github.com/luci/luci-go/common/clock" | 17 "github.com/luci/luci-go/common/clock" |
18 "github.com/luci/luci-go/common/clock/testclock" | 18 "github.com/luci/luci-go/common/clock/testclock" |
19 » "github.com/luci/luci-go/common/mathrand" | 19 » "github.com/luci/luci-go/common/data/rand/mathrand" |
20 . "github.com/luci/luci-go/common/testing/assertions" | 20 . "github.com/luci/luci-go/common/testing/assertions" |
21 . "github.com/smartystreets/goconvey/convey" | 21 . "github.com/smartystreets/goconvey/convey" |
22 "golang.org/x/net/context" | 22 "golang.org/x/net/context" |
23 ) | 23 ) |
24 | 24 |
25 func TestTaskQueue(t *testing.T) { | 25 func TestTaskQueue(t *testing.T) { |
26 t.Parallel() | 26 t.Parallel() |
27 | 27 |
28 Convey("TaskQueue", t, func() { | 28 Convey("TaskQueue", t, func() { |
29 now := time.Date(2000, time.January, 1, 1, 1, 1, 1, time.UTC) | 29 now := time.Date(2000, time.January, 1, 1, 1, 1, 1, time.UTC) |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 }() | 405 }() |
406 | 406 |
407 So(tqt.GetScheduledTasks()["default"][t.Name], S
houldResemble, t) | 407 So(tqt.GetScheduledTasks()["default"][t.Name], S
houldResemble, t) |
408 So(tqt.GetTombstonedTasks()["default"][t2.Name],
ShouldResemble, t2) | 408 So(tqt.GetTombstonedTasks()["default"][t2.Name],
ShouldResemble, t2) |
409 So(tqt.GetTransactionTasks()["default"], ShouldB
eNil) | 409 So(tqt.GetTransactionTasks()["default"], ShouldB
eNil) |
410 }) | 410 }) |
411 | 411 |
412 }) | 412 }) |
413 }) | 413 }) |
414 } | 414 } |
OLD | NEW |