(self, obj, name, msg=None)
| 17 | self.fail(self._formatMessage(msg, standardMsg)) |
| 18 | |
| 19 | def assertHasAttr(self, obj, name, msg=None): |
| 20 | if not hasattr(obj, name): |
| 21 | if isinstance(obj, types.ModuleType): |
| 22 | standardMsg = f'module {obj.__name__!r} has no attribute {name!r}' |
| 23 | elif isinstance(obj, type): |
| 24 | standardMsg = f'type object {obj.__name__!r} has no attribute {name!r}' |
| 25 | else: |
| 26 | standardMsg = f'{type(obj).__name__!r} object has no attribute {name!r}' |
| 27 | self.fail(self._formatMessage(msg, standardMsg)) |
| 28 | |
| 29 | def assertNotHasAttr(self, obj, name, msg=None): |
| 30 | if hasattr(obj, name): |
no test coverage detected