def assert_element_text_matches(output, path, expression):
 text = xml_find_text(output, path)
 if (re.match(expression, text) is None):
  errmsg = ("Expected element with path '%s' to contain text matching '%s', instead text '%s' was found." % (path, expression, text))
  raise AssertionError(errmsg)

def assert_element_text_matches ( output , path , expression ) : text = xml_find_text ( output , path ) if ( re . match ( expression , text ) is None ) : errmsg = ( "Expected element with path '%s' to contain text matching '%s', instead text '%s' was found." % ( path , expression , text ) ) raise AssertionError ( errmsg )
asserts the text of the first element matching the specified path matches the specified regular expression .