Skip to content

Commit 62d906c

Browse files
committed
GetPushRule -> MustGetPushRule
1 parent d78bd2a commit 62d906c

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

client/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,12 @@ func (c *CSAPI) GetAllPushRules(t ct.TestLike) gjson.Result {
261261
return gjson.ParseBytes(pushRulesBytes)
262262
}
263263

264-
// GetPushRule queries the contents of a client's push rule by scope, kind and rule ID.
264+
// MustGetPushRule queries the contents of a client's push rule by scope, kind and rule ID.
265265
// A parsed gjson result is returned. Fails the test if the query to server returns a non-2xx status code.
266266
//
267267
// Example of checking that a global underride rule contains the expected actions:
268268
//
269-
// containsDisplayNameRule := c.GetPushRule(t, "global", "underride", ".m.rule.contains_display_name")
269+
// containsDisplayNameRule := c.MustGetPushRule(t, "global", "underride", ".m.rule.contains_display_name")
270270
// must.MatchGJSON(
271271
// t,
272272
// containsDisplayNameRule,
@@ -276,7 +276,7 @@ func (c *CSAPI) GetAllPushRules(t ct.TestLike) gjson.Result {
276276
// map[string]interface{}{"set_tweak": "highlight"},
277277
// }),
278278
// )
279-
func (c *CSAPI) GetPushRule(t ct.TestLike, scope string, kind string, ruleID string) gjson.Result {
279+
func (c *CSAPI) MustGetPushRule(t ct.TestLike, scope string, kind string, ruleID string) gjson.Result {
280280
t.Helper()
281281

282282
res := c.MustDo(t, "GET", []string{"_matrix", "client", "v3", "pushrules", scope, kind, ruleID})

tests/msc3930/msc3930_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestPollsLocalPushRules(t *testing.T) {
3939
// Request each of the push rule IDs defined by MSC3930 and verify their structure.
4040

4141
// This push rule silences all poll responses.
42-
pollResponseRule := alice.GetPushRule(t, "global", "override", pollResponseRuleID)
42+
pollResponseRule := alice.MustGetPushRule(t, "global", "override", pollResponseRuleID)
4343
must.MatchGJSON(
4444
t,
4545
pollResponseRule,
@@ -55,7 +55,7 @@ func TestPollsLocalPushRules(t *testing.T) {
5555
)
5656

5757
// This push rule creates a sound and notifies the user when a poll is started in a one-to-one room.
58-
pollStartOneToOneRule := alice.GetPushRule(t, "global", "underride", pollStartOneToOneRuleID)
58+
pollStartOneToOneRule := alice.MustGetPushRule(t, "global", "underride", pollStartOneToOneRuleID)
5959
must.MatchGJSON(
6060
t,
6161
pollStartOneToOneRule,
@@ -78,7 +78,7 @@ func TestPollsLocalPushRules(t *testing.T) {
7878
)
7979

8080
// This push rule creates a sound and notifies the user when a poll is ended in a one-to-one room.
81-
pollEndOneToOneRule := alice.GetPushRule(t, "global", "underride", pollEndOneToOneRuleID)
81+
pollEndOneToOneRule := alice.MustGetPushRule(t, "global", "underride", pollEndOneToOneRuleID)
8282
must.MatchGJSON(
8383
t,
8484
pollEndOneToOneRule,
@@ -101,7 +101,7 @@ func TestPollsLocalPushRules(t *testing.T) {
101101
)
102102

103103
// This push rule notifies the user when a poll is started in any room.
104-
pollStartRule := alice.GetPushRule(t, "global", "underride", pollStartRuleID)
104+
pollStartRule := alice.MustGetPushRule(t, "global", "underride", pollStartRuleID)
105105
must.MatchGJSON(
106106
t,
107107
pollStartRule,
@@ -118,7 +118,7 @@ func TestPollsLocalPushRules(t *testing.T) {
118118
)
119119

120120
// This push rule notifies the user when a poll is ended in any room.
121-
pollEndRule := alice.GetPushRule(t, "global", "underride", pollEndRuleID)
121+
pollEndRule := alice.MustGetPushRule(t, "global", "underride", pollEndRuleID)
122122
must.MatchGJSON(
123123
t,
124124
pollEndRule,

0 commit comments

Comments
 (0)