| Conditions | 5 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | from hamcrest.core.base_matcher import BaseMatcher |
||
| 10 | def matches(self, item, mismatch_description=None): |
||
| 11 | try: |
||
| 12 | if len(item) == 0: |
||
| 13 | return True |
||
| 14 | |||
| 15 | if mismatch_description: |
||
| 16 | mismatch_description \ |
||
| 17 | .append_text('has %d item(s)' % len(item)) |
||
| 18 | |||
| 19 | except TypeError: |
||
| 20 | if mismatch_description: |
||
| 21 | mismatch_description \ |
||
| 22 | .append_text('does not support length') |
||
| 23 | |||
| 24 | return False |
||
| 25 | |||
| 36 |