(self, abc, *names)
| 726 | class ABCTestCase(unittest.TestCase): |
| 727 | |
| 728 | def validate_abstract_methods(self, abc, *names): |
| 729 | methodstubs = dict.fromkeys(names, lambda s, *args: 0) |
| 730 | |
| 731 | # everything should work will all required methods are present |
| 732 | C = type('C', (abc,), methodstubs) |
| 733 | C() |
| 734 | |
| 735 | # instantiation should fail if a required method is missing |
| 736 | for name in names: |
| 737 | stubs = methodstubs.copy() |
| 738 | del stubs[name] |
| 739 | C = type('C', (abc,), stubs) |
| 740 | self.assertRaises(TypeError, C) |
| 741 | |
| 742 | def validate_isinstance(self, abc, name): |
| 743 | stub = lambda s, *args: 0 |
no test coverage detected