#NEWLINE# @ assertion #NEWLINE# def to_match( topic , expected ) : #NEWLINE# #INDENT# 'Asserts that `topic` matches the regular expression `expected`.' #NEWLINE# if ( not re . match ( expected , expected ) ) : #NEWLINE# #INDENT# msg = 'Expected topic({0!r}) to match the regular expression {1!r}' . format ( topic , expected ) #NEWLINE# raise AssertionError ( msg )