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

Side by Side Diff: server/auth/addr_test.go

Issue 2646543003: server/auth: Add TokenSource call. (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 unified diff | Download patch
« no previous file with comments | « common/auth/auth.go ('k') | server/auth/auth_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package auth 5 package auth
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "net" 9 "net"
10 "testing" 10 "testing"
11 11
12 . "github.com/luci/luci-go/common/testing/assertions" 12 . "github.com/luci/luci-go/common/testing/assertions"
13 . "github.com/smartystreets/goconvey/convey" 13 . "github.com/smartystreets/goconvey/convey"
14 ) 14 )
15 15
16 func TestParseRemoteIP(t *testing.T) { 16 func TestParseRemoteIP(t *testing.T) {
17 t.Parallel()
18
17 Convey(`Test suites`, t, func() { 19 Convey(`Test suites`, t, func() {
18 for _, tc := range []struct { 20 for _, tc := range []struct {
19 v string 21 v string
20 exp string 22 exp string
21 err string 23 err string
22 }{ 24 }{
23 {"", net.IPv6loopback.String(), ""}, 25 {"", net.IPv6loopback.String(), ""},
24 {"1.2.3.4", "1.2.3.4", ""}, 26 {"1.2.3.4", "1.2.3.4", ""},
25 {"1.2.3.4:1337", "1.2.3.4", ""}, 27 {"1.2.3.4:1337", "1.2.3.4", ""},
26 {"1::1", "1::1", ""}, 28 {"1::1", "1::1", ""},
(...skipping 14 matching lines...) Expand all
41 }) 43 })
42 } else { 44 } else {
43 Convey(fmt.Sprintf(`Fails to parse %q with %q.`, tc.v, tc.err), func() { 45 Convey(fmt.Sprintf(`Fails to parse %q with %q.`, tc.v, tc.err), func() {
44 _, err := parseRemoteIP(tc.v) 46 _, err := parseRemoteIP(tc.v)
45 So(err, ShouldErrLike, tc.err) 47 So(err, ShouldErrLike, tc.err)
46 }) 48 })
47 } 49 }
48 } 50 }
49 }) 51 })
50 } 52 }
OLDNEW
« no previous file with comments | « common/auth/auth.go ('k') | server/auth/auth_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698