Demo entry 6640643

Python

   

Submitted by anonymous on Sep 12, 2017 at 15:22
Language: Python. Code size: 1.5 kB.

def testEmailSend_Must(self):
        """WFMaaS.EmailSend.case.011"""
        ret = self.client.GetOneEmailService(email=MailUser+"@"+MailDomain)
        self.assertEqual(len(ret),1)
        ServerId = ret["result"]["server_id"]
        
        userinfo = self.client.GetPersonInfo(PlatformUserName)              
        
        ret = self.client.SendEmail(ServerId=ServerId, From=MailUser+"@"+MailDomain, To=userinfo["value"], Title="", Content="empty Title:"+self.idx, CC="", BCC="", Attachment="", GroupRecursion="", DataType="")
        logging.debug("empty Title:%s", str(ret))
        self.assert_(ret.has_key("errorCode"))        

        adminemail = SendRecvEmail.SendRecvEmail(MailIP, MailIP, PlatformUserName, PlatformUserName)
        receiveEmail = adminemail.wait_mail("", 30, 1,"empty Title:"+self.idx)
        logging.info("email receive: %s",receiveEmail)
        self.assertEqual(len(receiveEmail), 0)

        ret = self.client.SendEmail(ServerId=ServerId, From=MailUser+"@"+MailDomain, To=userinfo["value"], Title="empty content"+self.idx, Content="", CC="", BCC="", Attachment="", GroupRecursion="", DataType="")
        logging.debug("empty content:%s", str(ret))
        self.assert_(ret.has_key("errorCode"))
        
        adminemail = SendRecvEmail.SendRecvEmail(MailIP, MailIP, PlatformUserName, PlatformUserName)
        receiveEmail = adminemail.wait_mail("empty content"+self.idx, 30, 1)
        logging.info("email receive: %s",receiveEmail)
        self.assertEqual(len(receiveEmail), 0)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).