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

Unified Diff: tokenserver/appengine/impl/certconfig/ca_test.go

Issue 2779323002: token-server: Warmup some local caches in /_ah/warmup. (Closed)
Patch Set: Created 3 years, 9 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: tokenserver/appengine/impl/certconfig/ca_test.go
diff --git a/tokenserver/appengine/impl/certconfig/ca_test.go b/tokenserver/appengine/impl/certconfig/ca_test.go
index ade0dc2a827816be3ee778df5ec483b3c9cea53b..abb6dbf545565cc1cb06ec5679b452a076f799b9 100644
--- a/tokenserver/appengine/impl/certconfig/ca_test.go
+++ b/tokenserver/appengine/impl/certconfig/ca_test.go
@@ -8,6 +8,8 @@ import (
"testing"
"time"
+ ds "github.com/luci/gae/service/datastore"
+
"github.com/luci/luci-go/appengine/gaetesting"
"github.com/luci/luci-go/common/clock/testclock"
"github.com/luci/luci-go/common/data/caching/proccache"
@@ -15,6 +17,26 @@ import (
. "github.com/smartystreets/goconvey/convey"
)
+func TestListCAs(t *testing.T) {
+ Convey("ListCAs works", t, func() {
+ ctx := gaetesting.TestingContext()
+
+ // Empty.
+ cas, err := ListCAs(ctx)
+ So(err, ShouldBeNil)
+ So(len(cas), ShouldEqual, 0)
+
+ // Add some.
+ err = ds.Put(ctx, &CA{CN: "abc", Removed: true}, &CA{CN: "def"})
+ So(err, ShouldBeNil)
+ ds.GetTestable(ctx).CatchupIndexes()
+
+ cas, err = ListCAs(ctx)
+ So(err, ShouldBeNil)
+ So(cas, ShouldResemble, []string{"def"})
+ })
+}
+
func TestCAUniqueIDToCNMapLoadStore(t *testing.T) {
Convey("CAUniqueIDToCNMap Load and Store works", t, func() {
ctx := gaetesting.TestingContext()

Powered by Google App Engine
This is Rietveld 408576698