Skip to content

Commit

Permalink
tests: model: Extend other tests to incorporate both mentioned flags.
Browse files Browse the repository at this point in the history
This commit expands some of the fixtures of present tests with the
mentioned/wildcard_mentioned flags to make the tests more robust
and generalized.
  • Loading branch information
zee-bit committed Jun 21, 2021
1 parent 8b4f8b9 commit dacdeda
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/model/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,8 @@ def test_toggle_stream_muted_status(
(["read"], "add"),
(["read", "starred"], "remove"),
(["starred", "read"], "remove"),
(["read", "mentioned", "wildcard_mentioned"], "add"),
(["mentioned", "wildcard_mentioned", "starred"], "remove"),
],
)
def test_toggle_message_star_status(
Expand Down Expand Up @@ -1990,11 +1992,18 @@ def test_update_star_status_invalid_operation(
("add", 1, ["read"], ["read", "starred"]),
("add", 1, ["starred"], ["starred"]),
("add", 1, ["read", "starred"], ["read", "starred"]),
("add", 1, ["mentioned"], ["mentioned", "starred"]),
("add", 1, ["mentioned", "starred"], ["mentioned", "starred"]),
("add", 1, ["wildcard_mentioned"], ["wildcard_mentioned", "starred"]),
("remove", -1, [], []),
("remove", -1, ["read"], ["read"]),
("remove", -1, ["starred"], []),
("remove", -1, ["read", "starred"], ["read"]),
("remove", -1, ["starred", "read"], ["read"]),
("remove", -1, ["mentioned"], ["mentioned"]),
("remove", -1, ["wildcard_mentioned"], ["wildcard_mentioned"]),
("remove", -1, ["mentioned", "starred"], ["mentioned"]),
("remove", -1, ["wildcard_mentioned", "starred"], ["wildcard_mentioned"]),
],
)
def test_update_star_status(
Expand Down Expand Up @@ -2073,11 +2082,19 @@ def test_update_star_status(
("add", ["read"], ["read"]),
("add", ["starred"], ["starred", "read"]),
("add", ["read", "starred"], ["read", "starred"]),
("add", ["mentioned"], ["mentioned", "read"]),
("add", ["read", "mentioned"], ["read", "mentioned"]),
("add", ["mentioned", "starred"], ["mentioned", "starred", "read"]),
("add", ["wildcard_mentioned"], ["wildcard_mentioned", "read"]),
("remove", [], []),
("remove", ["read"], ["read"]), # msg cannot be marked 'unread'
("remove", ["starred"], ["starred"]),
("remove", ["mentioned"], ["mentioned"]),
("remove", ["starred", "read"], ["starred", "read"]),
("remove", ["read", "starred"], ["read", "starred"]),
("remove", ["read", "mentioned"], ["read", "mentioned"]),
("remove", ["wildcard_mentioned"], ["wildcard_mentioned"]),
("remove", ["read", "wildcard_mentioned"], ["read", "wildcard_mentioned"]),
],
)
def test_update_read_status(
Expand Down

0 comments on commit dacdeda

Please sign in to comment.