コード例 #1
0
ファイル: test_modules.py プロジェクト: phpnoida/testingyar
 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)
コード例 #2
0
ファイル: test_modules.py プロジェクト: phpnoida/testingyar
 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)
コード例 #3
0
ファイル: test_modules.py プロジェクト: phpnoida/testingyar
 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_)
コード例 #4
0
ファイル: test_modules.py プロジェクト: 0xD3ADB33F/rapidsms
 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)
コード例 #5
0
ファイル: test_modules.py プロジェクト: 0xD3ADB33F/rapidsms
 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)
コード例 #6
0
ファイル: test_modules.py プロジェクト: 0xD3ADB33F/rapidsms
 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_)