-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcloudstack_test.go
More file actions
31 lines (27 loc) · 821 Bytes
/
cloudstack_test.go
File metadata and controls
31 lines (27 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package cloudstack
import (
"fmt"
"net/http"
"net/http/httptest"
"net/url"
"testing"
)
func TestKeyAuthentication(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "")
}))
defer server.Close()
endpoint, _ := url.Parse(server.URL)
client, _ := NewClient(endpoint, "APIKEY", "SECRETKEY", "", "")
client.Request("listZones", map[string]interface{}{})
}
// func TestPasswordAuthentication(t *testing.T) {
// server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// fmt.Fprintln(w, "")
// }))
// defer server.Close()
//
// endpoint, _ := url.Parse(server.URL)
// client, _ := NewClient(endpoint, "", "", "admin", "password")
// client.Request("listZones", map[string]interface{}{})
// }