| Total Complexity | 3 |
| Total Lines | 11 |
| Duplicated Lines | 0 % |
| 1 | from hamcrest.core.base_matcher import BaseMatcher |
||
| 9 | class HasString(BaseMatcher): |
||
| 10 | |||
| 11 | def __init__(self, str_matcher): |
||
| 12 | self.str_matcher = str_matcher |
||
| 13 | |||
| 14 | def _matches(self, item): |
||
| 15 | return self.str_matcher.matches(str(item)) |
||
| 16 | |||
| 17 | def describe_to(self, description): |
||
| 18 | description.append_text('an object with str ') \ |
||
| 19 | .append_description_of(self.str_matcher) |
||
| 20 | |||
| 41 |