diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-20 14:28:08 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-20 14:28:08 +0200 |
| commit | 1c54936626a4a30d0c6f69576a06ba3661f39dc6 (patch) | |
| tree | 426c76b4c55cf9a9efbc7bd1aa957baec57b2892 /src/server_test.go | |
| parent | 77c9f266553cbadfd5fb150a26c2162b705f151e (diff) | |
Profiles: Implement SetProfileID instead of getting generic data
Diffstat (limited to 'src/server_test.go')
| -rw-r--r-- | src/server_test.go | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/server_test.go b/src/server_test.go index 3045983..6199884 100644 --- a/src/server_test.go +++ b/src/server_test.go @@ -35,13 +35,10 @@ func LoginOAuthSelenium(t *testing.T, url string) { } } -func StateCallback(t *testing.T, oldState string, newState string, data string) string { +func StateCallback(t *testing.T, oldState string, newState string, data string) { if newState == "OAuth_Started" { go LoginOAuthSelenium(t, data) } - - // We have no data to send back - return "" } func Test_server(t *testing.T) { @@ -50,8 +47,8 @@ func Test_server(t *testing.T) { // Do not verify because during testing, the cert is self-signed http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} - state.Register("org.eduvpn.app.linux", "configstest", func(old string, new string, data string) string { - return StateCallback(t, old, new, data) + state.Register("org.eduvpn.app.linux", "configstest", func(old string, new string, data string) { + StateCallback(t, old, new, data) }, false) _, configErr := state.Connect("https://eduvpnserver") @@ -68,7 +65,7 @@ func test_connect_oauth_parameter(t *testing.T, parameters URLParameters, expect // Do not verify because during testing, the cert is self-signed http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} - state.Register("org.eduvpn.app.linux", "configsnologin", func(oldState string, newState string, data string) string { + state.Register("org.eduvpn.app.linux", "configsnologin", func(oldState string, newState string, data string) { if newState == "OAuth_Started" { baseURL := "http://127.0.0.1:8000/callback" url, err := HTTPConstructURL(baseURL, parameters) @@ -78,8 +75,6 @@ func test_connect_oauth_parameter(t *testing.T, parameters URLParameters, expect go http.Get(url) } - // We have no data to send back - return "" }, false) _, configErr := state.Connect("https://eduvpnserver") @@ -129,8 +124,8 @@ func Test_token_expired(t *testing.T) { // Do not verify because during testing, the cert is self-signed http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} - state.Register("org.eduvpn.app.linux", "configsexpired", func(old string, new string, data string) string { - return StateCallback(t, old, new, data) + state.Register("org.eduvpn.app.linux", "configsexpired", func(old string, new string, data string) { + StateCallback(t, old, new, data) }, false) _, configErr := state.Connect("https://eduvpnserver") |
