Commit 8db2e92c authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

More API tests.

parent cf2dc406
......@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"os"
"reflect"
"strings"
"sync"
"time"
......@@ -265,12 +266,30 @@ func TestApi(t *testing.T) {
t.Errorf("Get wildcard user: %v", err)
}
desc, err = group.GetDescription("test")
if err != nil {
t.Errorf("GetDescription: %v", err)
}
if !reflect.DeepEqual(user, *desc.WildcardUser) {
t.Errorf("Got %v, expected %v", desc.WildcardUser, user)
}
resp, err = do("DELETE", "/galene-api/v0/.groups/test/.wildcard-user",
"", "", "", "")
if err != nil || resp.StatusCode != http.StatusNoContent {
t.Errorf("Delete wildcard user: %v %v", err, resp.StatusCode)
}
desc, err = group.GetDescription("test")
if err != nil {
t.Errorf("GetDescription: %v", err)
}
if desc.WildcardUser != nil {
t.Errorf("Got %v, expected nil", desc.WildcardUser)
}
if len(desc.AuthKeys) != 1 {
t.Errorf("Keys: %v", len(desc.AuthKeys))
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment