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() |