Exemplo n.º 1
0
 def test_register_retrieve_driver(self):
     """Register driver and retrieve it again"""
     driver = self.register_empty_driver("some_type", "some_name")
     self.assertTrue(drivers.get_driver("some_type", "some_name") is driver)
Exemplo n.º 2
0
    def test_get_driver_default(self):
        user = utils.get_test_user()
        expected_driver = drivers.get_driver('messaging', 'fake')

        actual_driver = messaging._get_driver(user)
        self.assertEquals(actual_driver, expected_driver)
Exemplo n.º 3
0
 def setUp(self):
     import surveilr.messaging.fake
     # This does nothing, but pyflakes gets upset if we import it
     # and never "use" it.
     surveilr.messaging.fake
     self.driver = drivers.get_driver('messaging', 'fake')
Exemplo n.º 4
0
    def test_get_driver_sms(self):
        user = utils.get_test_user(messaging_driver='sms')
        expected_driver = drivers.get_driver('messaging', 'sms')

        actual_driver = messaging._get_driver(user)
        self.assertEquals(actual_driver, expected_driver)
Exemplo n.º 5
0
def _get_driver(recipient):
    return drivers.get_driver('messaging',
                              getattr(recipient, 'messaging_driver', 'fake'))
Exemplo n.º 6
0
 def __init__(self):
     driver_name = config.get_str('sms', 'driver')
     self.driver = drivers.get_driver('sms', driver_name)