Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: impl/memory/taskqueue_test.go

Issue 1890983004: service/taskqueue: Add NewPOSTTask, remove NewTask (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Zero value. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | service/taskqueue/interface.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/taskqueue_test.go
diff --git a/impl/memory/taskqueue_test.go b/impl/memory/taskqueue_test.go
index eb2de337aea324b5c6b4e29c2ef91d1c2d022cdf..686bc7e95540962584d8c71e05fd8b6302cfcbd5 100644
--- a/impl/memory/taskqueue_test.go
+++ b/impl/memory/taskqueue_test.go
@@ -39,7 +39,7 @@ func TestTaskQueue(t *testing.T) {
Convey("implements TQMultiReadWriter", func() {
Convey("Add", func() {
- t := tq.NewTask("/hello/world")
+ t := &tqS.Task{Path: "/hello/world"}
Convey("works", func() {
t.Delay = 4 * time.Second
@@ -66,7 +66,7 @@ func TestTaskQueue(t *testing.T) {
So(err, ShouldBeNil)
tq = tqS.Get(c)
- t := tq.NewTask("")
+ t := &tqS.Task{}
So(tq.Add(t, ""), ShouldBeNil)
So(t.Header, ShouldResemble, http.Header{
"X-Appengine-Current-Namespace": {"coolNamespace"},
@@ -158,7 +158,7 @@ func TestTaskQueue(t *testing.T) {
Convey("stats work too", func() {
delay := -time.Second * 400
- t := tq.NewTask("/somewhere")
+ t := &tqS.Task{Path: "/somewhere"}
t.Delay = delay
So(tq.Add(t, ""), ShouldBeNil)
@@ -382,7 +382,7 @@ func TestTaskQueue(t *testing.T) {
Convey("adding a new task only happens if we don't errout", func() {
So(dsS.Get(c).RunInTransaction(func(c context.Context) error {
- t3 := tq.NewTask("/sandwitch/victory")
+ t3 := &tqS.Task{Path: "/sandwitch/victory"}
So(tqS.Get(c).Add(t3, ""), ShouldBeNil)
return fmt.Errorf("nooooo")
}, nil), ShouldErrLike, "nooooo")
@@ -398,7 +398,7 @@ func TestTaskQueue(t *testing.T) {
So(dsS.Get(c).RunInTransaction(func(c context.Context) error {
tq := tqS.Get(c)
- So(tq.Add(tq.NewTask("/sandwitch/victory"), ""), ShouldBeNil)
+ So(tq.Add(&tqS.Task{Path: "/sandwitch/victory"}, ""), ShouldBeNil)
panic(fmt.Errorf("nooooo"))
}, nil), ShouldBeNil)
« no previous file with comments | « no previous file | service/taskqueue/interface.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698