Total Complexity | 4 |
Total Lines | 12 |
Duplicated Lines | 0 % |
1 | from hamcrest.library.text.substringmatcher import SubstringMatcher |
||
9 | class StringEndsWith(SubstringMatcher): |
||
10 | |||
11 | def __init__(self, substring): |
||
12 | super(StringEndsWith, self).__init__(substring) |
||
13 | |||
14 | def _matches(self, item): |
||
15 | if not hasmethod(item, 'endswith'): |
||
16 | return False |
||
17 | return item.endswith(self.substring) |
||
18 | |||
19 | def relationship(self): |
||
20 | return 'ending with' |
||
21 | |||
40 |