Refactor mail contrib with CmdMail, CmdMailCharacter etc. Resolves #1802

This commit is contained in:
Griatch 2019-04-07 21:50:27 +02:00
parent aaea53f46d
commit a5aec53a9e
4 changed files with 146 additions and 86 deletions

View file

@ -728,16 +728,16 @@ from evennia.contrib import mail
class TestMail(CommandTest):
def test_mail(self):
self.call(mail.CmdMail(), "2", "'2' is not a valid mail id.", caller=self.account)
self.call(mail.CmdMail(), "test", "'test' is not a valid mail id.")
self.call(mail.CmdMail(), "test", "'test' is not a valid mail id.", caller=self.account)
self.call(mail.CmdMail(), "", "There are no messages in your inbox.", caller=self.account)
self.call(mail.CmdMail(), "Char=Message 1",
self.call(mail.CmdMailCharacter(), "Char=Message 1",
"You have received a new @mail from Char|You sent your message.", caller=self.char1)
self.call(mail.CmdMail(), "Char=Message 2", "You sent your message.", caller=self.char2)
self.call(mail.CmdMailCharacter(), "Char=Message 2", "You sent your message.", caller=self.char2)
self.call(mail.CmdMail(), "TestAccount2=Message 2",
"You have received a new @mail from TestAccount2", caller=self.account2)
self.call(mail.CmdMail(), "TestAccount=Message 1", "You sent your message.", caller=self.account2)
self.call(mail.CmdMail(), "TestAccount=Message 2", "You sent your message.", caller=self.account2)
self.call(mail.CmdMail(), "", "| ID: From: Subject:", caller=self.account)
self.call(mail.CmdMail(), "", "| ID From Subject", caller=self.account)
self.call(mail.CmdMail(), "2", "From: TestAccount2", caller=self.account)
self.call(mail.CmdMail(), "/forward TestAccount2 = 1/Forward message", "You sent your message.|Message forwarded.", caller=self.account)
self.call(mail.CmdMail(), "/reply 2=Reply Message2", "You sent your message.", caller=self.account)