feat(oo): project team CRUD and user lifecycle (block/unblock/password/delete)
Release Please / Release Please (push) Skipped
Release / GoReleaser (push) Skipped
Tests / Secret scan (gitleaks) (push) Skipped
Tests / Test (Go 1.25) (push) Skipped
Tests / Test (Go stable) (push) Skipped
Tests / Secret scan (gitleaks) (pull_request) Successful in 4s
Tests / Test (Go 1.25) (pull_request) Successful in 1m2s
Tests / Test (Go stable) (pull_request) Successful in 1m40s
Release Please / Release Please (push) Skipped
Release / GoReleaser (push) Skipped
Tests / Secret scan (gitleaks) (push) Skipped
Tests / Test (Go 1.25) (push) Skipped
Tests / Test (Go stable) (push) Skipped
Tests / Secret scan (gitleaks) (pull_request) Successful in 4s
Tests / Test (Go 1.25) (pull_request) Successful in 1m2s
Tests / Test (Go stable) (pull_request) Successful in 1m40s
- project team: oo projects team list|add|remove|set (portal users) - users: get|create|update|delete|block|unblock|password - lib: CreateUser, DeleteUser (auto-suspend before delete), Add/Remove/ SetProjectTeam, ListProjectTeam; deleteJSON reused; jsonBodyReader helper - tests: unmarshalResponseArray
This commit is contained in:
@@ -48,3 +48,26 @@ func TestUnmarshalResponseObjectNull(t *testing.T) {
|
||||
t.Fatalf("expected nil, got %#v", out)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnmarshalResponseArrayList(t *testing.T) {
|
||||
raw := json.RawMessage(`{"response":[{"id":"a","displayName":"A"},{"id":"b","displayName":"B"}]}`)
|
||||
out, err := unmarshalResponseArray(raw)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(out) != 2 || out[0]["id"] != "a" || out[1]["displayName"] != "B" {
|
||||
t.Fatalf("unexpected list: %#v", out)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnmarshalResponseArrayNullAndScalar(t *testing.T) {
|
||||
for _, raw := range []string{`{"response":null}`, `{"response":{}}`, `{"response":"x"}`} {
|
||||
out, err := unmarshalResponseArray(json.RawMessage(raw))
|
||||
if err != nil {
|
||||
t.Fatalf("%s: %v", raw, err)
|
||||
}
|
||||
if out != nil {
|
||||
t.Fatalf("%s: expected nil, got %#v", raw, out)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user