| 1487 | self.fail(self._formatMessage(msg, standardMsg)) |
| 1488 | |
| 1489 | def assertNotStartsWith(self, s, prefix, msg=None): |
| 1490 | try: |
| 1491 | if not s.startswith(prefix): |
| 1492 | return |
| 1493 | except (AttributeError, TypeError): |
| 1494 | self._tail_type_check(s, prefix, msg) |
| 1495 | raise |
| 1496 | if isinstance(prefix, tuple): |
| 1497 | for x in prefix: |
| 1498 | if s.startswith(x): |
| 1499 | prefix = x |
| 1500 | break |
| 1501 | a = safe_repr(s, short=True) |
| 1502 | b = safe_repr(prefix) |
| 1503 | self.fail(self._formatMessage(msg, f"{a} starts with {b}")) |
| 1504 | |
| 1505 | def assertEndsWith(self, s, suffix, msg=None): |
| 1506 | try: |