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

Unified Diff: luci_config/server/cfgclient/config_test.go

Issue 2642343003: luci_config: Request content only when desired. (Closed)
Patch Set: Created 3 years, 11 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 | « luci_config/server/cfgclient/config.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: luci_config/server/cfgclient/config_test.go
diff --git a/luci_config/server/cfgclient/config_test.go b/luci_config/server/cfgclient/config_test.go
index c03a7cc1af6237908a65742c9a360e6c4134913f..7607f4006b0713829b968828d3a276179fbe4df2 100644
--- a/luci_config/server/cfgclient/config_test.go
+++ b/luci_config/server/cfgclient/config_test.go
@@ -23,11 +23,13 @@ type testingBackend struct {
err error
items []*backend.Item
url url.URL
+ lastParams backend.Params
}
func (tb *testingBackend) ServiceURL(context.Context) url.URL { return *tb.serviceURL }
func (tb *testingBackend) Get(c context.Context, configSet, path string, p backend.Params) (*backend.Item, error) {
+ tb.lastParams = p
if err := tb.err; err != nil {
return nil, tb.err
}
@@ -40,6 +42,7 @@ func (tb *testingBackend) Get(c context.Context, configSet, path string, p backe
func (tb *testingBackend) GetAll(c context.Context, t backend.GetAllTarget, path string, p backend.Params) (
[]*backend.Item, error) {
+ tb.lastParams = p
if err := tb.err; err != nil {
return nil, tb.err
}
@@ -47,6 +50,7 @@ func (tb *testingBackend) GetAll(c context.Context, t backend.GetAllTarget, path
}
func (tb *testingBackend) ConfigSetURL(c context.Context, configSet string, p backend.Params) (url.URL, error) {
+ tb.lastParams = p
return tb.url, tb.err
}
@@ -164,6 +168,7 @@ func TestConfig(t *testing.T) {
var meta Meta
So(Get(c, AsService, "", "", nil, &meta), ShouldBeNil)
So(meta, ShouldResemble, Meta{"projects/foo", "path", "####", "v1"})
+ So(tb.lastParams.Content, ShouldBeFalse)
})
Convey(`Multi`, func() {
@@ -173,6 +178,7 @@ func TestConfig(t *testing.T) {
{"projects/foo", "path", "####", "v1"},
{"projects/bar", "path", "####", "v1"},
})
+ So(tb.lastParams.Content, ShouldBeFalse)
})
})
« no previous file with comments | « luci_config/server/cfgclient/config.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698