Skip to content

Commit 4d86f15

Browse files
committed
Add non-failing GetPushRule
1 parent 62d906c commit 4d86f15

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

client/client.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,20 @@ func (c *CSAPI) GetAllPushRules(t ct.TestLike) gjson.Result {
279279
func (c *CSAPI) MustGetPushRule(t ct.TestLike, scope string, kind string, ruleID string) gjson.Result {
280280
t.Helper()
281281

282-
res := c.MustDo(t, "GET", []string{"_matrix", "client", "v3", "pushrules", scope, kind, ruleID})
282+
res := c.GetPushRule(t, scope, kind, ruleID)
283+
mustRespond2xx(t, res)
284+
283285
pushRuleBytes := ParseJSON(t, res)
284286
return gjson.ParseBytes(pushRuleBytes)
285287
}
286288

289+
// GetPushRule queries the contents of a client's push rule by scope, kind and rule ID.
290+
func (c *CSAPI) GetPushRule(t ct.TestLike, scope string, kind string, ruleID string) *http.Response {
291+
t.Helper()
292+
293+
return c.Do(t, "GET", []string{"_matrix", "client", "v3", "pushrules", scope, kind, ruleID})
294+
}
295+
287296
// SetPushRule creates a new push rule on the user, or modifies an existing one.
288297
// If `before` or `after` parameters are not set to an empty string, their values
289298
// will be set as the `before` and `after` query parameters respectively on the

0 commit comments

Comments
 (0)