only look for regexes in strings

This commit is contained in:
Honza Král
2014-02-03 21:42:59 +01:00
parent aefc942fa5
commit c4f7cb6182
@@ -172,7 +172,8 @@ class YamlTestCase(ElasticTestCase):
value = self._lookup(path)
expected = self._resolve(expected)
if expected.startswith('/') and expected.endswith('/'):
if isinstance(expected, (type(''), type(u''))) and \
expected.startswith('/') and expected.endswith('/'):
expected = re.compile(expected[1:-1], re.VERBOSE)
self.assertTrue(expected.search(value))
else: