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

Unified Diff: impl/memory/taskqueue_test.go

Issue 2995493002: [impl/memory] Enforce named tasks during txn. (Closed)
Patch Set: Created 3 years, 4 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 | « impl/memory/taskqueue.go ('k') | no next file » | 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 db23c0c0aabce75ea7fec2db02d4c600bda72c06..d438e57fae88992a509e7dc03a8575e70c46f436 100644
--- a/impl/memory/taskqueue_test.go
+++ b/impl/memory/taskqueue_test.go
@@ -356,6 +356,8 @@ func TestTaskQueue(t *testing.T) {
})
Convey("unless you add too many things", func() {
+ t.Name = ""
+
So(ds.RunInTransaction(c, func(c context.Context) error {
for i := 0; i < 5; i++ {
So(tq.Add(c, "", t.Duplicate()), ShouldBeNil)
@@ -366,6 +368,8 @@ func TestTaskQueue(t *testing.T) {
})
Convey("unless you Add to a bad queue", func() {
+ t.Name = ""
+
So(ds.RunInTransaction(c, func(c context.Context) error {
So(tq.Add(c, "meat", t).Error(), ShouldContainSubstring, "UNKNOWN_QUEUE")
@@ -378,6 +382,16 @@ func TestTaskQueue(t *testing.T) {
}, nil), ShouldBeNil)
})
+ Convey("unless the task is named", func() {
+ So(ds.RunInTransaction(c, func(c context.Context) error {
+ err := tq.Add(c, "", t) // Note: "t" has a Name from initial Add.
+ So(err, ShouldNotBeNil)
+ So(err.Error(), ShouldContainSubstring, "INVALID_TASK_NAME")
+
+ return nil
+ }, nil), ShouldBeNil)
+ })
+
Convey("No other features are available, however", func() {
So(ds.RunInTransaction(c, func(c context.Context) error {
So(tq.Delete(c, "", t).Error(), ShouldContainSubstring, "cannot DeleteMulti from a transaction")
« no previous file with comments | « impl/memory/taskqueue.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698