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

Unified Diff: logdog/common/viewer/url_test.go

Issue 2456953003: LogDog: Update client/bootstrap to generate URLs. (Closed)
Patch Set: Winders Created 4 years, 2 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 | « logdog/common/viewer/url.go ('k') | milo/appengine/swarming/memoryClient.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/common/viewer/url_test.go
diff --git a/logdog/common/viewer/url_test.go b/logdog/common/viewer/url_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..75b7544891bba4cdf0fe284a341d9d9364042d10
--- /dev/null
+++ b/logdog/common/viewer/url_test.go
@@ -0,0 +1,39 @@
+// Copyright 2015 The LUCI Authors. All rights reserved.
+// Use of this source code is governed under the Apache License, Version 2.0
+// that can be found in the LICENSE file.
+
+package viewer
+
+import (
+ "fmt"
+ "testing"
+
+ "github.com/luci/luci-go/common/config"
+ "github.com/luci/luci-go/logdog/common/types"
+
+ . "github.com/smartystreets/goconvey/convey"
+)
+
+func TestGetURL(t *testing.T) {
+ t.Parallel()
+
+ Convey(`Testing viewer URL generation`, t, func() {
+ for _, tc := range []struct {
+ host string
+ project config.ProjectName
+ paths []types.StreamPath
+ url string
+ }{
+ {"example.appspot.com", "test", []types.StreamPath{"foo/bar/+/baz"},
+ "https://example.appspot.com/v/?s=test%2Ffoo%2Fbar%2F%2B%2Fbaz"},
+ {"example.appspot.com", "test", []types.StreamPath{"foo/bar/+/baz", "qux/+/quux"},
+ "https://example.appspot.com/v/?s=test%2Ffoo%2Fbar%2F%2B%2Fbaz&s=test%2Fqux%2F%2B%2Fquux"},
+ {"example.appspot.com", "test", []types.StreamPath{"query/*/+/**"},
+ "https://example.appspot.com/v/?s=test%2Fquery%2F%2A%2F%2B%2F%2A%2A"},
+ } {
+ Convey(fmt.Sprintf(`Can generate a URL for host %q, project %q, paths %q: [%s]`, tc.host, tc.project, tc.paths, tc.url), func() {
+ So(GetURL(tc.host, tc.project, tc.paths...), ShouldEqual, tc.url)
+ })
+ }
+ })
+}
« no previous file with comments | « logdog/common/viewer/url.go ('k') | milo/appengine/swarming/memoryClient.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698