Esempio n. 1
0
 def test_multiple_classes_found(self):
     """An error should be raised if multiple classes are found."""
     module = import_module('rapidsms.utils.test_modules')
     self.assertRaises(AttributeError, get_class, module, ParentA)
Esempio n. 2
0
 def test_no_classes_found(self):
     """An error should be raised if no classes are found."""
     from rapidsms.backends.base import BackendBase
     module = import_module('rapidsms.utils.test_modules')
     self.assertRaises(AttributeError, get_class, module, BackendBase)
Esempio n. 3
0
 def test_get_class(self):
     """get_class() should return the proper class."""
     module = import_module('rapidsms.utils.test_modules')
     class_ = get_class(module, ParentB)
     self.assertEqual(ParentB, class_)
Esempio n. 4
0
 def test_multiple_classes_found(self):
     """An error should be raised if multiple classes are found."""
     module = import_module('rapidsms.utils.test_modules')
     self.assertRaises(AttributeError, get_class, module, ParentA)
Esempio n. 5
0
 def test_no_classes_found(self):
     """An error should be raised if no classes are found."""
     from rapidsms.backends.base import BackendBase
     module = import_module('rapidsms.utils.test_modules')
     self.assertRaises(AttributeError, get_class, module, BackendBase)
Esempio n. 6
0
 def test_get_class(self):
     """get_class() should return the proper class."""
     module = import_module('rapidsms.utils.test_modules')
     class_ = get_class(module, ParentB)
     self.assertEqual(ParentB, class_)