Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
f1d0e307
Commit
f1d0e307
authored
Feb 17, 2016
by
Eric Chiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
session: remove unused function argument
parent
ed5dee99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
manager_test.go
session/manager/manager_test.go
+7
-7
No files found.
session/manager/manager_test.go
View file @
f1d0e307
...
...
@@ -15,13 +15,13 @@ func staticGenerateCodeFunc(code string) GenerateCodeFunc {
}
}
func
newManager
(
t
*
testing
.
T
)
*
SessionManager
{
func
newManager
()
*
SessionManager
{
dbMap
:=
db
.
NewMemDB
()
return
NewSessionManager
(
db
.
NewSessionRepo
(
dbMap
),
db
.
NewSessionKeyRepo
(
dbMap
))
}
func
TestSessionManagerNewSession
(
t
*
testing
.
T
)
{
sm
:=
newManager
(
t
)
sm
:=
newManager
()
sm
.
GenerateCode
=
staticGenerateCodeFunc
(
"boo"
)
got
,
err
:=
sm
.
NewSession
(
"bogus_idpc"
,
"XXX"
,
"bogus"
,
url
.
URL
{},
""
,
false
,
[]
string
{
"openid"
})
if
err
!=
nil
{
...
...
@@ -33,7 +33,7 @@ func TestSessionManagerNewSession(t *testing.T) {
}
func
TestSessionAttachRemoteIdentityTwice
(
t
*
testing
.
T
)
{
sm
:=
newManager
(
t
)
sm
:=
newManager
()
sessionID
,
err
:=
sm
.
NewSession
(
"bogus_idpc"
,
"XXX"
,
"bogus"
,
url
.
URL
{},
""
,
false
,
[]
string
{
"openid"
})
if
err
!=
nil
{
t
.
Fatalf
(
"Unexpected error: %v"
,
err
)
...
...
@@ -50,7 +50,7 @@ func TestSessionAttachRemoteIdentityTwice(t *testing.T) {
}
func
TestSessionManagerExchangeKey
(
t
*
testing
.
T
)
{
sm
:=
newManager
(
t
)
sm
:=
newManager
()
sessionID
,
err
:=
sm
.
NewSession
(
"connector_id"
,
"XXX"
,
"bogus"
,
url
.
URL
{},
""
,
false
,
[]
string
{
"openid"
})
if
err
!=
nil
{
t
.
Fatalf
(
"Unexpected error: %v"
,
err
)
...
...
@@ -75,7 +75,7 @@ func TestSessionManagerExchangeKey(t *testing.T) {
}
func
TestSessionManagerGetSessionInStateNoExist
(
t
*
testing
.
T
)
{
sm
:=
newManager
(
t
)
sm
:=
newManager
()
ses
,
err
:=
sm
.
getSessionInState
(
"123"
,
session
.
SessionStateNew
)
if
err
==
nil
{
t
.
Errorf
(
"Expected non-nil error"
)
...
...
@@ -86,7 +86,7 @@ func TestSessionManagerGetSessionInStateNoExist(t *testing.T) {
}
func
TestSessionManagerGetSessionInStateWrongState
(
t
*
testing
.
T
)
{
sm
:=
newManager
(
t
)
sm
:=
newManager
()
sessionID
,
err
:=
sm
.
NewSession
(
"connector_id"
,
"XXX"
,
"bogus"
,
url
.
URL
{},
""
,
false
,
[]
string
{
"openid"
})
if
err
!=
nil
{
t
.
Fatalf
(
"Unexpected error: %v"
,
err
)
...
...
@@ -101,7 +101,7 @@ func TestSessionManagerGetSessionInStateWrongState(t *testing.T) {
}
func
TestSessionManagerKill
(
t
*
testing
.
T
)
{
sm
:=
newManager
(
t
)
sm
:=
newManager
()
sessionID
,
err
:=
sm
.
NewSession
(
"connector_id"
,
"XXX"
,
"bogus"
,
url
.
URL
{},
""
,
false
,
[]
string
{
"openid"
})
if
err
!=
nil
{
t
.
Fatalf
(
"Unexpected error: %v"
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment