Rev 27: Rename a function to make it non-public. in http://bazaar.launchpad.net/+branch/goose
John Arbash Meinel
john at arbash-meinel.com
Sun Nov 11 11:06:58 UTC 2012
At http://bazaar.launchpad.net/+branch/goose
------------------------------------------------------------
revno: 27
revision-id: john at arbash-meinel.com-20121111110650-90l4cvq6gok0dy2c
parent: john at arbash-meinel.com-20121111104808-m0c8eq8lvk5z5tbx
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: goose
timestamp: Sun 2012-11-11 11:06:50 +0000
message:
Rename a function to make it non-public.
-------------- next part --------------
=== modified file 'testservices/identityservice/userpass_test.go'
--- a/testservices/identityservice/userpass_test.go 2012-11-01 15:44:16 +0000
+++ b/testservices/identityservice/userpass_test.go 2012-11-11 11:06:50 +0000
@@ -38,7 +38,7 @@
}
}`
-func UserPassAuthRequest(URL, user, key string) (*http.Response, error) {
+func userPassAuthRequest(URL, user, key string) (*http.Response, error) {
client := &http.Client{}
body := strings.NewReader(fmt.Sprintf(authTemplate, user, key))
request, err := http.NewRequest("POST", URL, body)
@@ -65,7 +65,7 @@
}
func (s *UserPassSuite) TestNotJSON(c *C) {
- // We do everything in UserPassAuthRequest, except set the Content-Type
+ // We do everything in userPassAuthRequest, except set the Content-Type
token := s.setupUserPass("user", "secret")
c.Assert(token, NotNil)
client := &http.Client{}
@@ -79,10 +79,10 @@
}
func (s *UserPassSuite) TestBadJSON(c *C) {
- // We do everything in UserPassAuthRequest, except set the Content-Type
+ // We do everything in userPassAuthRequest, except set the Content-Type
token := s.setupUserPass("user", "secret")
c.Assert(token, NotNil)
- res, err := UserPassAuthRequest(s.Server.URL, "garbage\"in", "secret")
+ res, err := userPassAuthRequest(s.Server.URL, "garbage\"in", "secret")
defer res.Body.Close()
c.Assert(err, IsNil)
CheckErrorResponse(c, res, http.StatusBadRequest, notJSON)
@@ -91,7 +91,7 @@
func (s *UserPassSuite) TestNoSuchUser(c *C) {
token := s.setupUserPass("user", "secret")
c.Assert(token, NotNil)
- res, err := UserPassAuthRequest(s.Server.URL, "not-user", "secret")
+ res, err := userPassAuthRequest(s.Server.URL, "not-user", "secret")
defer res.Body.Close()
c.Assert(err, IsNil)
CheckErrorResponse(c, res, http.StatusUnauthorized, notAuthorized)
@@ -100,7 +100,7 @@
func (s *UserPassSuite) TestBadPassword(c *C) {
token := s.setupUserPass("user", "secret")
c.Assert(token, NotNil)
- res, err := UserPassAuthRequest(s.Server.URL, "user", "not-secret")
+ res, err := userPassAuthRequest(s.Server.URL, "user", "not-secret")
defer res.Body.Close()
c.Assert(err, IsNil)
CheckErrorResponse(c, res, http.StatusUnauthorized, invalidUser)
@@ -109,7 +109,7 @@
func (s *UserPassSuite) TestValidAuthorization(c *C) {
token := s.setupUserPass("user", "secret")
c.Assert(token, NotNil)
- res, err := UserPassAuthRequest(s.Server.URL, "user", "secret")
+ res, err := userPassAuthRequest(s.Server.URL, "user", "secret")
defer res.Body.Close()
c.Assert(err, IsNil)
c.Check(res.StatusCode, Equals, http.StatusOK)
More information about the bazaar-commits
mailing list