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

Unified Diff: impl/memory/taskqueue_test.go

Issue 1282673002: Make obtaining the Testable interface actually part of the interface. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: Created 5 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_data.go ('k') | impl/prod/taskqueue.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 ebbfc297c9bab16d01c3e67c0120e3184d33ead2..a7f6d076e3aa5afb0cf3a46ce9c04a9f408f3988 100644
--- a/impl/memory/taskqueue_test.go
+++ b/impl/memory/taskqueue_test.go
@@ -31,7 +31,8 @@ func TestTaskQueue(t *testing.T) {
c = Use(c)
tq := tqS.Get(c)
- tqt := tq.Raw().(tqS.Testable)
+ tqt := tq.Testable()
+ So(tqt, ShouldNotBeNil)
So(tq, ShouldNotBeNil)
@@ -245,7 +246,7 @@ func TestTaskQueue(t *testing.T) {
Convey("can view regular tasks", func() {
dsS.Get(c).RunInTransaction(func(c context.Context) error {
- tqt := tqS.Get(c).Raw().(tqS.Testable)
+ tqt := tqS.Get(c).Testable()
So(tqt.GetScheduledTasks()["default"][t.Name], ShouldResemble, t)
So(tqt.GetTombstonedTasks()["default"][t2.Name], ShouldResemble, t2)
@@ -259,7 +260,7 @@ func TestTaskQueue(t *testing.T) {
err := dsS.Get(c).RunInTransaction(func(c context.Context) error {
tq := tqS.Get(c)
- tqt := tq.Raw().(tqS.Testable)
+ tqt := tq.Testable()
So(tq.Add(t3, ""), ShouldBeNil)
So(t3.Name, ShouldEqual, "")
@@ -291,7 +292,7 @@ func TestTaskQueue(t *testing.T) {
dsS.Get(c).RunInTransaction(func(c context.Context) error {
ttq = tqS.Get(c)
- tqt := ttq.Raw().(tqS.Testable)
+ tqt := ttq.Testable()
So(ttq.Add(t3, ""), ShouldBeNil)
@@ -320,7 +321,7 @@ func TestTaskQueue(t *testing.T) {
Convey("you can AddMulti as well", func() {
dsS.Get(c).RunInTransaction(func(c context.Context) error {
tq := tqS.Get(c)
- tqt := tq.Raw().(tqS.Testable)
+ tqt := tq.Testable()
t.Name = ""
tasks := []*tqS.Task{t.Duplicate(), t.Duplicate(), t.Duplicate()}
@@ -348,7 +349,7 @@ func TestTaskQueue(t *testing.T) {
So(tqS.Get(c).Add(t, "meat").Error(), ShouldContainSubstring, "UNKNOWN_QUEUE")
Convey("unless you add it!", func() {
- tqS.Get(c).Raw().(tqS.Testable).CreateQueue("meat")
+ tqS.Get(c).Testable().CreateQueue("meat")
So(tqS.Get(c).Add(t, "meat"), ShouldBeNil)
})
@@ -382,10 +383,7 @@ func TestTaskQueue(t *testing.T) {
func() {
defer func() { recover() }()
dsS.Get(c).RunInTransaction(func(c context.Context) error {
- tq := tqS.Get(c).(interface {
- tqS.Testable
- tqS.Interface
- })
+ tq := tqS.Get(c)
So(tq.Add(tq.NewTask("/sandwitch/victory"), ""), ShouldBeNil)
« no previous file with comments | « impl/memory/taskqueue_data.go ('k') | impl/prod/taskqueue.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698