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

Unified Diff: service/datastore/interface.go

Issue 1285703002: Add testable interface for datastore. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: rebase 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
Index: service/datastore/interface.go
diff --git a/service/datastore/interface.go b/service/datastore/interface.go
index f767a81261489630e957770586b4d24c8f92b799..9eef7e7b6cd66c939dfc56204964f3550e492f3d 100644
--- a/service/datastore/interface.go
+++ b/service/datastore/interface.go
@@ -140,4 +140,8 @@ type Interface interface {
// be used interchangably; there's no danger of interleaving access to the
// datastore via the two.
Raw() RawInterface
+
+ // Testable returns the Testable interface for the implementation, or nil if
+ // there is none.
+ Testable() Testable
dnj (Google) 2015/08/14 22:53:54 Since most implementations return nil here, should
iannucci 2015/08/15 01:59:25 There's no way to cast to it, which is why I'm doi
dnj (Google) 2015/08/15 02:07:53 I was thinking something like: testable := memory
}

Powered by Google App Engine
This is Rietveld 408576698