Ejemplo n.º 1
0
 def test_check(self):
     res = PhoneService({}).check('test-req-id', '1111')
     expected = {
         'status': 'error',
         'error': 'Phone service is not configured'
     }
     assert_equal(res, expected)
Ejemplo n.º 2
0
 def test_verify(self):
     res = PhoneService({}).verify('1234567890')
     expected = {
         'status': 'error',
         'error': 'Phone service is not configured'
     }
     assert_equal(res, expected)
Ejemplo n.º 3
0
 def test_get_method(self):
     config = {'phone.method': 'mock'}
     entry_points = {'mock': MockPhoneService}
     phone = PhoneService.get(config, entry_points)
     assert_true(isinstance(phone, MockPhoneService))
Ejemplo n.º 4
0
 def test_get_default(self):
     config = {}
     entry_points = None
     phone = PhoneService.get(config, entry_points)
     assert_true(isinstance(phone, PhoneService))
Ejemplo n.º 5
0
 def test_get_method(self):
     config = {'phone.method': 'mock'}
     entry_points = {'mock': MockPhoneService}
     phone = PhoneService.get(config, entry_points)
     assert_true(isinstance(phone, MockPhoneService))
Ejemplo n.º 6
0
 def test_get_default(self):
     config = {}
     entry_points = None
     phone = PhoneService.get(config, entry_points)
     assert_true(isinstance(phone, PhoneService))