Exemple #1
0
class SMSTests(SandboxResourceTest):
 
    def setUp(self):
        from sprintkit.services import SMS
        config = self.get_Config()
        self.sms = SMS(config)

    def test_send_with_valid_mdn(self):
        self.sms.send(params.valid_mdn, 'hello')
    
    def test_send_with_spaces_in_msg(self):
        self.sms.send(params.valid_mdn, 'hello there')
    
    def test_send_with_long_msg(self):
        self.sms.send(params.valid_mdn, 'a'*165)
   
    def test_send_with_invalid_mdn(self):
        self.assertRaises(SandboxError, self.sms.send, '123456789', 'hello')
    
    def test_send_with_invalid_key(self):
        self.sms.config['key'] = 'INVALIDKEY'
        self.assertRaises(SandboxError, self.sms.send, params.valid_mdn, 'hello')
    
    def test_send_with_invalid_secret(self):
        self.sms.config['secret'] = 'INVALIDSECRET'
        self.assertRaises(SandboxError, self.sms.send, params.valid_mdn, 'hello')
Exemple #2
0
 def setUp(self):
     from sprintkit.services import SMS
     config = self.get_Config()
     self.sms = SMS(config)