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

Side by Side Diff: impl/memory/user_test.go

Issue 1525923002: Implement Mail service. (Closed) Base URL: https://github.com/luci/gae.git@filter_user
Patch Set: add tests Created 5 years 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package memory 5 package memory
6 6
7 import ( 7 import (
8 "testing" 8 "testing"
9 9
10 userS "github.com/luci/gae/service/user" 10 userS "github.com/luci/gae/service/user"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 usr, err := user.CurrentOAuth("scope") 83 usr, err := user.CurrentOAuth("scope")
84 So(usr, ShouldBeNil) 84 So(usr, ShouldBeNil)
85 So(err, ShouldBeNil) 85 So(err, ShouldBeNil)
86 }) 86 })
87 }) 87 })
88 88
89 Convey("panics on bad email", func() { 89 Convey("panics on bad email", func() {
90 So(func() { 90 So(func() {
91 user.Testable().Login("bademail", "", false) 91 user.Testable().Login("bademail", "", false)
92 » » » }, ShouldPanicLike, `"bademail" doesn't seem to be a val id email`) 92 » » » }, ShouldPanicLike, `mail: missing phrase`)
martiniss 2015/12/16 21:54:15 Ummm. This error message doesn't mean much to me.
iannucci 2015/12/17 00:01:07 comes from "net/mail"
93
94 » » » So(func() {
95 » » » » user.Testable().Login("too@many@ats.com", "", fa lse)
96 » » » }, ShouldPanicLike, `"too@many@ats.com" doesn't seem to be a valid email`)
97 }) 93 })
98 94
99 Convey("fake URLs", func() { 95 Convey("fake URLs", func() {
100 url, err := user.LoginURL("https://funky.example.com") 96 url, err := user.LoginURL("https://funky.example.com")
101 So(err, ShouldBeNil) 97 So(err, ShouldBeNil)
102 So(url, ShouldEqual, "https://fakeapp.example.com/_ah/lo gin?redirect=https%3A%2F%2Ffunky.example.com") 98 So(url, ShouldEqual, "https://fakeapp.example.com/_ah/lo gin?redirect=https%3A%2F%2Ffunky.example.com")
103 99
104 url, err = user.LogoutURL("https://funky.example.com") 100 url, err = user.LogoutURL("https://funky.example.com")
105 So(err, ShouldBeNil) 101 So(err, ShouldBeNil)
106 So(url, ShouldEqual, "https://fakeapp.example.com/_ah/lo gout?redirect=https%3A%2F%2Ffunky.example.com") 102 So(url, ShouldEqual, "https://fakeapp.example.com/_ah/lo gout?redirect=https%3A%2F%2Ffunky.example.com")
107 }) 103 })
108 104
109 Convey("Some stuff is deprecated", func() { 105 Convey("Some stuff is deprecated", func() {
110 url, err := user.LoginURLFederated("https://something", "something") 106 url, err := user.LoginURLFederated("https://something", "something")
111 So(err, ShouldErrLike, "LoginURLFederated is deprecated" ) 107 So(err, ShouldErrLike, "LoginURLFederated is deprecated" )
112 So(url, ShouldEqual, "") 108 So(url, ShouldEqual, "")
113 109
114 key, err := user.OAuthConsumerKey() 110 key, err := user.OAuthConsumerKey()
115 So(err, ShouldErrLike, "OAuthConsumerKey is deprecated") 111 So(err, ShouldErrLike, "OAuthConsumerKey is deprecated")
116 So(key, ShouldEqual, "") 112 So(key, ShouldEqual, "")
117 }) 113 })
118 114
119 }) 115 })
120 } 116 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698