Exemplo n.º 1
0
    def test_normal(self):
        c = SubmitSmContent(self.body, self.replyto, 1, self.expiration)

        self.assertEquals(c.body, self.body)
        self.assertEquals(c['reply-to'], self.replyto)
        self.assertEquals(c['priority'], 1)
        self.assertEquals(c['headers']['expiration'], self.expiration)
        self.assertNotEquals(c['message-id'], None)
Exemplo n.º 2
0
    def test_normal(self):
        c = SubmitSmContent(self.body, self.replyto, 1, self.expiration)

        self.assertEquals(c.body, self.body)
        self.assertEquals(c['reply-to'], self.replyto)
        self.assertEquals(c['priority'], 1)
        self.assertEquals(c['headers']['expiration'], self.expiration)
        self.assertEquals(c['headers']['source_connector'], 'httpapi')
        self.assertNotEquals(c['message-id'], None)
        self.assertTrue('created_at' in c['headers'])
Exemplo n.º 3
0
    def test_unique_messageid(self):
        counter = 0
        maxCounter = 10000
        msgIds = []
        while 1:
            if counter == maxCounter:
                break
            else:
                counter += 1

            c = SubmitSmContent(self.body, self.replyto)
            self.assertEquals(
                msgIds.count(c['message-id']), 0,
                "Collision detected at position %s/%s" % (counter, maxCounter))
            msgIds.append(c['message-id'])
Exemplo n.º 4
0
    def test_minimal_arguments(self):
        c = SubmitSmContent(self.body, self.replyto)

        self.assertEquals(c['priority'], 1)
        self.assertNotEquals(c['message-id'], None)