mirror of
https://github.com/hanzoai/oauthful.git
synced 2026-10-30 18:26:32 +00:00
39 lines
556 B
Go
39 lines
556 B
Go
package oauthful
|
|
|
|
import (
|
|
"flag"
|
|
"net/http"
|
|
"net/url"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
type TestFlow struct {
|
|
}
|
|
|
|
func (t TestFlow) Decode(req *http.Request) (*AuthorizationResponse, error) {
|
|
return &AuthorizationResponse{}, nil
|
|
}
|
|
|
|
func (t TestFlow) Verify(res *AuthorizationResponse) error {
|
|
return nil
|
|
}
|
|
|
|
func (t TestFlow) AddParams(vals *url.Values) error {
|
|
return nil
|
|
}
|
|
|
|
func TestMain(m *testing.M) {
|
|
var err error
|
|
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
flag.Parse()
|
|
os.Exit(m.Run())
|
|
}
|
|
|
|
func CreateClient() {
|
|
_ = New(&http.Client{}, "localhost", TestFlow{})
|
|
}
|