@@ -78,6 +78,12 @@ def _add_matcher_specific_properties_to_json(self):
7878 }
7979 }
8080
81+ def __str__ (self ):
82+ """Return string Representation."""
83+ return 'in whitelist [{whitelist}]' .format (
84+ whitelist = ',' .join ('"{}"' .format (item ) for item in self ._whitelist )
85+ )
86+
8187
8288class StartsWithMatcher (Matcher ):
8389 """Matcher that returns true if the key is a prefix of the stored value."""
@@ -119,6 +125,12 @@ def _add_matcher_specific_properties_to_json(self):
119125 }
120126 }
121127
128+ def __str__ (self ):
129+ """Return string Representation."""
130+ return 'has one of the following prefixes [{whitelist}]' .format (
131+ whitelist = ',' .join ('"{}"' .format (item ) for item in self ._whitelist )
132+ )
133+
122134
123135class EndsWithMatcher (Matcher ):
124136 """Matcher that returns true if the key ends with the suffix stored in matcher data."""
@@ -160,6 +172,12 @@ def _add_matcher_specific_properties_to_json(self):
160172 }
161173 }
162174
175+ def __str__ (self ):
176+ """Return string Representation."""
177+ return 'has one of the following suffixes [{whitelist}]' .format (
178+ whitelist = ',' .join ('"{}"' .format (item ) for item in self ._whitelist )
179+ )
180+
163181
164182class ContainsStringMatcher (Matcher ):
165183 """Matcher that returns true if the input key is part of the string in matcher data."""
@@ -201,6 +219,12 @@ def _add_matcher_specific_properties_to_json(self):
201219 }
202220 }
203221
222+ def __str__ (self ):
223+ """Return string Representation."""
224+ return 'contains one of the following string: [{whitelist}]' .format (
225+ whitelist = ',' .join ('"{}"' .format (item ) for item in self ._whitelist )
226+ )
227+
204228
205229class RegexMatcher (Matcher ):
206230 """Matcher that returns true if the user input matches the regex stored in the matcher."""
0 commit comments