forked from tildetown/bbj2
37 lines
636 B
Go
37 lines
636 B
Go
package api
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.tilde.town/tildetown/bbj2/server/cmd/config"
|
|
)
|
|
|
|
func TestInstanceInfo(t *testing.T) {
|
|
ts := []struct {
|
|
name string
|
|
opts config.Options
|
|
wantResp *BBJResponse
|
|
wantErr *HTTPError
|
|
}{}
|
|
|
|
for _, tt := range ts {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
api := &API{
|
|
Opts: config.Options{
|
|
// TODO
|
|
},
|
|
User: nil,
|
|
}
|
|
resp, err := api.InstanceInfo()
|
|
if tt.wantErr != nil && err != nil {
|
|
t.Errorf("got unwanted error: %s", err.Error())
|
|
return
|
|
}
|
|
if tt.wantResp != resp {
|
|
t.Errorf("wanted %#v got %#v", tt.wantResp, resp)
|
|
return
|
|
}
|
|
})
|
|
}
|
|
}
|