diff options
author | asatarin <asatarin@yandex-team.ru> | 2022-02-10 16:47:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:30 +0300 |
commit | ca04a556317a80ac802f38457a2292185282878b (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /contrib/python/PyHamcrest/src/hamcrest/library/text/stringcontains.py | |
parent | 4ca29390ac54b7877174de542de47532c67453b5 (diff) | |
download | ydb-ca04a556317a80ac802f38457a2292185282878b.tar.gz |
Restoring authorship annotation for <asatarin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/PyHamcrest/src/hamcrest/library/text/stringcontains.py')
-rw-r--r-- | contrib/python/PyHamcrest/src/hamcrest/library/text/stringcontains.py | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/contrib/python/PyHamcrest/src/hamcrest/library/text/stringcontains.py b/contrib/python/PyHamcrest/src/hamcrest/library/text/stringcontains.py index e309b5a116..58ffd283c6 100644 --- a/contrib/python/PyHamcrest/src/hamcrest/library/text/stringcontains.py +++ b/contrib/python/PyHamcrest/src/hamcrest/library/text/stringcontains.py @@ -1,38 +1,38 @@ -from hamcrest.library.text.substringmatcher import SubstringMatcher -from hamcrest.core.helpers.hasmethod import hasmethod - -__author__ = "Jon Reid" -__copyright__ = "Copyright 2011 hamcrest.org" -__license__ = "BSD, see License.txt" - - -class StringContains(SubstringMatcher): - - def __init__(self, substring): - super(StringContains, self).__init__(substring) - - def _matches(self, item): - if not hasmethod(item, 'find'): - return False - return item.find(self.substring) >= 0 - - def relationship(self): - return 'containing' - - -def contains_string(substring): - """Matches if object is a string containing a given string. - - :param string: The string to search for. - - This matcher first checks whether the evaluated object is a string. If so, - it checks whether it contains ``string``. - - Example:: - - contains_string("def") - - will match "abcdefg". - - """ - return StringContains(substring) +from hamcrest.library.text.substringmatcher import SubstringMatcher +from hamcrest.core.helpers.hasmethod import hasmethod + +__author__ = "Jon Reid" +__copyright__ = "Copyright 2011 hamcrest.org" +__license__ = "BSD, see License.txt" + + +class StringContains(SubstringMatcher): + + def __init__(self, substring): + super(StringContains, self).__init__(substring) + + def _matches(self, item): + if not hasmethod(item, 'find'): + return False + return item.find(self.substring) >= 0 + + def relationship(self): + return 'containing' + + +def contains_string(substring): + """Matches if object is a string containing a given string. + + :param string: The string to search for. + + This matcher first checks whether the evaluated object is a string. If so, + it checks whether it contains ``string``. + + Example:: + + contains_string("def") + + will match "abcdefg". + + """ + return StringContains(substring) |