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

Unified Diff: client/internal/lhttp/utils_test.go

Issue 1135173003: Create packages client/internal/ retry and lhttp. (Closed) Base URL: git@github.com:luci/luci-go@3_UI
Patch Set: Create lhttp.Retriable interface Created 5 years, 7 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 | « client/internal/lhttp/utils.go ('k') | client/internal/retry/doc.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/internal/lhttp/utils_test.go
diff --git a/client/internal/lhttp/utils_test.go b/client/internal/lhttp/utils_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..a7fb3d2dcacc10f977ff6e9adf1766a2d5c672c7
--- /dev/null
+++ b/client/internal/lhttp/utils_test.go
@@ -0,0 +1,29 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package lhttp
+
+import (
+ "errors"
+ "testing"
+
+ "github.com/maruel/ut"
+)
+
+func TestURLToHTTPS(t *testing.T) {
+ data := []struct {
+ in string
+ expected string
+ err error
+ }{
+ {"foo", "https://foo", nil},
+ {"https://foo", "https://foo", nil},
+ {"http://foo", "", errors.New("Only https:// scheme is accepted. It can be omitted.")},
+ }
+ for i, line := range data {
+ out, err := URLToHTTPS(line.in)
+ ut.AssertEqualIndex(t, i, line.expected, out)
+ ut.AssertEqualIndex(t, i, line.err, err)
+ }
+}
« no previous file with comments | « client/internal/lhttp/utils.go ('k') | client/internal/retry/doc.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698