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

Unified Diff: common/config/impl/remote/remote_test.go

Issue 2643803003: config: Update remote URL handling. (Closed)
Patch Set: Fix "nost" 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 | « common/config/impl/remote/remote.go ('k') | common/config/interface.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/config/impl/remote/remote_test.go
diff --git a/common/config/impl/remote/remote_test.go b/common/config/impl/remote/remote_test.go
index 70074fd91fd7f35c44597e162b9478ecbf87c348..90ab42520ecd309e2a919585922a4d307db1101c 100644
--- a/common/config/impl/remote/remote_test.go
+++ b/common/config/impl/remote/remote_test.go
@@ -30,7 +30,12 @@ func testTools(code int, resp interface{}) (*httptest.Server, config.Interface)
marsh, _ := json.Marshal(resp)
fmt.Fprintln(w, string(marsh))
}))
- return server, New(server.URL, nil)
+
+ u, err := url.Parse(server.URL)
+ if err != nil {
+ panic(err)
+ }
+ return server, New(u.Host, true, nil)
}
func TestRemoteCalls(t *testing.T) {
@@ -231,14 +236,14 @@ func TestRemoteCalls(t *testing.T) {
Convey("Should handle errors well", t, func() {
Convey("Should enforce GetConfigSetLocation argument is not the empty string.", func() {
- remoteImpl := New("http://example.com", nil)
+ remoteImpl := New("example.com", true, nil)
_, err := remoteImpl.GetConfigSetLocation(ctx, "")
So(err, ShouldNotBeNil)
})
Convey("Should pass through HTTP errors", func() {
- remoteImpl := New("http://example.com", func(context.Context) (*http.Client, error) {
+ remoteImpl := New("example.com", true, func(context.Context) (*http.Client, error) {
return &http.Client{
Transport: failingRoundTripper{},
}, nil
« no previous file with comments | « common/config/impl/remote/remote.go ('k') | common/config/interface.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698