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
f219964f
Commit
f219964f
authored
Aug 19, 2016
by
Eric Chiang
Committed by
GitHub
Aug 19, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #561 from ericchiang/dev-run-server-tests-at-non-root-url
dev branch: run server tests at a non-root URL
parents
f6e63672
4fe7260b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
server_test.go
server/server_test.go
+5
-4
No files found.
server/server_test.go
View file @
f219964f
...
...
@@ -59,11 +59,12 @@ FDWV28nTP9sqbtsmU8Tem2jzMvZ7C/Q0AuDoKELFUpux8shm8wfIhyaPnXUGZoAZ
Np4vUwMSYV5mopESLWOg3loBxKyLGFtgGKVCjGiQvy6zISQ4fQo=
-----END RSA PRIVATE KEY-----`
)
func
newTestServer
()
(
*
httptest
.
Server
,
*
Server
)
{
func
newTestServer
(
path
string
)
(
*
httptest
.
Server
,
*
Server
)
{
var
server
*
Server
s
:=
httptest
.
NewServer
(
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
server
.
ServeHTTP
(
w
,
r
)
}))
s
.
URL
=
s
.
URL
+
path
config
:=
Config
{
Issuer
:
s
.
URL
,
Storage
:
memory
.
New
(),
...
...
@@ -84,14 +85,14 @@ func newTestServer() (*httptest.Server, *Server) {
}
func
TestNewTestServer
(
t
*
testing
.
T
)
{
newTestServer
()
newTestServer
(
""
)
}
func
TestDiscovery
(
t
*
testing
.
T
)
{
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
httpServer
,
_
:=
newTestServer
()
httpServer
,
_
:=
newTestServer
(
"/nonrootpath"
)
defer
httpServer
.
Close
()
p
,
err
:=
oidc
.
NewProvider
(
ctx
,
httpServer
.
URL
)
...
...
@@ -117,7 +118,7 @@ func TestOAuth2Flow(t *testing.T) {
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
httpServer
,
s
:=
newTestServer
()
httpServer
,
s
:=
newTestServer
(
"/nonrootpath"
)
defer
httpServer
.
Close
()
p
,
err
:=
oidc
.
NewProvider
(
ctx
,
httpServer
.
URL
)
...
...
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