XEP-0461: add get fallback body helper

This commit is contained in:
nicoco
2022-11-22 10:23:52 +01:00
parent 7300f1285e
commit 9b89401b36
2 changed files with 20 additions and 0 deletions

View File

@@ -61,5 +61,15 @@ class TestReply(SlixTest):
"""
)
def testGetFallBackBody(self):
body = "Anna wrote:\nHi, how are you?"
quoted = "> Anna wrote:\n> Hi, how are you?\n"
msg = Message()
msg["body"] = "Great"
msg["feature_fallback"].add_quoted_fallback(body)
body2 = msg["feature_fallback"].get_fallback_body()
self.assertTrue(body2 == quoted, body2)
suite = unittest.TestLoader().loadTestsFromTestCase(TestReply)