MCPcopy Create free account
hub / github.com/chatmail/core / test_mute

Method test_mute

python/tests/test_3_offline.py:308–326  ·  view source on GitHub ↗
(self, ac1)

Source from the content-addressed store, hash-verified

306 assert chat.get_profile_image() is None
307
308 def test_mute(self, ac1):
309 chat = ac1.create_group_chat(name="title1")
310 assert not chat.is_muted()
311 assert chat.get_mute_duration() == 0
312 chat.mute()
313 assert chat.is_muted()
314 assert chat.get_mute_duration() == -1
315 chat.unmute()
316 assert not chat.is_muted()
317 chat.mute(50)
318 assert chat.is_muted()
319 assert chat.get_mute_duration() <= 50
320 with pytest.raises(ValueError):
321 chat.mute(-51)
322
323 # Regression test, this caused Rust panic previously
324 chat.mute(2**63 - 1)
325 assert chat.is_muted()
326 assert chat.get_mute_duration() == -1
327
328 def test_delete_and_send_fails(self, ac1, chat1):
329 chat1.delete()

Callers

nothing calls this directly

Calls 5

get_mute_durationMethod · 0.80
create_group_chatMethod · 0.45
is_mutedMethod · 0.45
muteMethod · 0.45
unmuteMethod · 0.45

Tested by

no test coverage detected