mirror of
https://github.com/jech/galene.git
synced 2024-11-22 08:35:57 +01:00
More API tests.
This commit is contained in:
parent
cf2dc406d5
commit
8db2e92cb9
1 changed files with 20 additions and 1 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue