Ejemplo n.º 1
0
    def test_SMSCharUTF8(self):
        self.nsadminHelper.configureGateway('HIGH', 'cardboardfishmock')
        messageArabic = "في شعري ، ونحن نعملمجمو باستمرار لمساعدة العملاء على تحقيق النجاح في الأسواق المتطورة بسرعة من خلال حلول عالمية"
        msgDict = {
            "messageClass": "SMS",
            "priority": "HIGH",
            "truncate": False,
            "message": messageArabic
        }
        resp = self.nsadminHelper.createAndSendMessage(msgDict)
        currentMonthTable = NSAdminHelper.getTableName()
        query = 'select status, message_count, message from ' + currentMonthTable + ' where id=' + str(
            resp)
        resp = dbHelper.queryDB(query, 'nsadmin')
        Assertion.constructAssertion(resp[0][0] in [7, 35], 'Messages status')
        Assertion.constructAssertion(
            resp[0][2].encode('utf8') == messageArabic, 'Arabic Char')
        Assertion.constructAssertion(resp[0][1] == 2, 'Message count')

        messageChinese = "在毛細管中,我們不斷努力,以幫助我們的客戶通過我們的世界級解決方案,服務和產品成功在快速發展的市場 - 將合併在毛細管中,我們不斷努力,以以- 將合併在毛細管中,我們不斷努力,以以"
        msgDict = {
            "messageClass": "SMS",
            "priority": "HIGH",
            "truncate": False,
            "message": messageChinese
        }
        resp = self.nsadminHelper.createAndSendMessage(msgDict)
        currentMonthTable = NSAdminHelper.getTableName()
        query = 'select status, message_count, message from ' + currentMonthTable + ' where id=' + str(
            resp)
        resp = dbHelper.queryDB(query, 'nsadmin')
        Assertion.constructAssertion(resp[0][0] in [7, 35], 'Messages status')
        Assertion.constructAssertion(
            resp[0][2].encode('utf8') == messageChinese, 'Chinese Char')
        Assertion.constructAssertion(resp[0][1] == 2, 'Message count')
Ejemplo n.º 2
0
    def test_SMScharLimit(self):
        self.nsadminHelper.configureGateway('HIGH', 'cardboardfishmock')
        message160CharSize = "At Capillary, we continuously work to help our clients succeed in rapidly evolving markets through our world-class solutions, services and products -  combining"
        msgDict = {
            "messageClass": "SMS",
            "priority": "HIGH",
            "message": message160CharSize
        }
        resp = self.nsadminHelper.createAndSendMessage(msgDict)
        currentMonthTable = NSAdminHelper.getTableName()
        query = 'select status, message_count, message from ' + currentMonthTable + ' where id=' + str(
            resp)
        resp = dbHelper.queryDB(query, 'nsadmin')
        Assertion.constructAssertion(resp[0][0] in [7, 35], 'Messages status')
        Assertion.constructAssertion(resp[0][2] == message160CharSize,
                                     '160 Char limit')
        Assertion.constructAssertion(resp[0][1] == 1, 'Message count')

        message320CharSize = "At Capillary, we continuously work to help our clients succeed in rapidly evolving markets through our world-class solutions, services and products. By combining big data with a robust, cloud-based analytics engine, we optimize the relevance and profitability of discounts and personalized offers to consumers in real time, significantly increasing both loyalty and sales"
        msgDict = {
            "messageClass": "SMS",
            "priority": "HIGH",
            "message": message320CharSize
        }
        resp = self.nsadminHelper.createAndSendMessage(msgDict)
        currentMonthTable = NSAdminHelper.getTableName()
        query = 'select status, message_count, message from ' + currentMonthTable + ' where id=' + str(
            resp)
        resp = dbHelper.queryDB(query, 'nsadmin')
        Assertion.constructAssertion(resp[0][0] in [7, 35], 'Messages status')
        Assertion.constructAssertion(resp[0][1] == 1,
                                     'Message count without truncate')

        msgDict = {
            "messageClass": "SMS",
            "priority": "HIGH",
            "truncate": False,
            "message": message320CharSize
        }
        resp = self.nsadminHelper.createAndSendMessage(msgDict)
        currentMonthTable = NSAdminHelper.getTableName()
        query = 'select status, message_count, message from ' + currentMonthTable + ' where id=' + str(
            resp)
        resp = dbHelper.queryDB(query, 'nsadmin')
        Assertion.constructAssertion(resp[0][0] in [7, 35], 'Messages status')
        Assertion.constructAssertion(resp[0][2] == message320CharSize,
                                     '320 Char limit')
        Assertion.constructAssertion(resp[0][1] == 3, 'Message count')
Ejemplo n.º 3
0
 def test_Count_Messages_RECEIVED_IN_QUEUE_READ(self):
     currentMonth = NSAdminHelper.getTableName()
     query = 'SELECT COUNT( * ) FROM ' + currentMonth + ' where sent_time >= SUBDATE( current_date, 2) and sent_time < current_date and status in (2,35)'
     output = dbHelper.queryDB(query, 'nsadmin')
     Assertion.constructAssertion(output[0][0] == 0,
                                  'RECEIVED_IN_QUEUE & READ count',
                                  verify=True)
Ejemplo n.º 4
0
 def test_Count_Messages_DELAYED_SCHEDULED(self):
     currentMonth = NSAdminHelper.getTableName()
     query = 'SELECT COUNT( * ) FROM ' + currentMonth + ' where sent_time >= SUBDATE( current_date, 2) and sent_time < current_date and status in (33)'
     output = dbHelper.queryDB(query, 'nsadmin')
     Assertion.constructAssertion(output[0][0] == 0,
                                  'DELAYED_SCHEDULED count')