diff options
author | Devtools Arcadia <arcadia-devtools@yandex-team.ru> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /contrib/python/PyHamcrest/src/hamcrest/library/text/substringmatcher.py | |
download | ydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'contrib/python/PyHamcrest/src/hamcrest/library/text/substringmatcher.py')
-rw-r--r-- | contrib/python/PyHamcrest/src/hamcrest/library/text/substringmatcher.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/python/PyHamcrest/src/hamcrest/library/text/substringmatcher.py b/contrib/python/PyHamcrest/src/hamcrest/library/text/substringmatcher.py new file mode 100644 index 0000000000..63ea359a51 --- /dev/null +++ b/contrib/python/PyHamcrest/src/hamcrest/library/text/substringmatcher.py @@ -0,0 +1,20 @@ +__author__ = "Jon Reid" +__copyright__ = "Copyright 2011 hamcrest.org" +__license__ = "BSD, see License.txt" + +from hamcrest.core.base_matcher import BaseMatcher + +import six + +class SubstringMatcher(BaseMatcher): + + def __init__(self, substring): + if not isinstance(substring, six.string_types): + raise TypeError(self.__class__.__name__ + ' requires string') + self.substring = substring + + def describe_to(self, description): + description.append_text('a string ') \ + .append_text(self.relationship()) \ + .append_text(' ') \ + .append_description_of(self.substring) |