#NEWLINE# def check_expression( testing_framework , expression_dict ) : #NEWLINE# #INDENT# '\n    >>> class mock_framework:\n    ...   def assertIn(self, item, list, msg="Failed asserting item is in list"):\n    ...     if item not in list: raise Exception(msg)\n    ...   def assertTrue(self, value, msg="Failed asserting true"):\n    ...     if not value: raise Exception(msg)\n    ...   def assertFalse(self, value, msg): self.assertTrue(not value, msg)\n    >>> check_expression(mock_framework(),\n    ...   {\'class\': {\'group\' :{\'Matches\': " 0 | 1", \'Non-Matches\': "2 | 0 2", \'Expression\': "[0-1]"}}})\n    ' #NEWLINE# expression_sub = get_expression_sub ( ) #NEWLINE# for ( expression_type_name , expression_type ) in expression_dict . items ( ) : #NEWLINE# #INDENT# for ( name , expression_object ) in expression_type . items ( ) : #NEWLINE# #INDENT# if ( 'Matches' in expression_object . keys ( ) ) : #NEWLINE# #INDENT# for test in expression_object [ 'Matches' ] . split ( '|' ) : #NEWLINE# #INDENT# result = ( expression_sub ( expression_object [ 'Expression' ] , '' , test . strip ( ) ) == '' ) #NEWLINE# testing_framework . assertTrue ( result , match_error_msg . format ( expression_type_name , name , test ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( 'Non-Matches' in expression_object . keys ( ) ) : #NEWLINE# #INDENT# for test in expression_object [ 'Non-Matches' ] . split ( '|' ) : #NEWLINE# #INDENT# result = ( expression_sub ( expression_object [ 'Expression' ] , '' , test . strip ( ) ) == '' ) #NEWLINE# testing_framework . assertFalse ( result , non_match_error_msg . format ( expression_type_name , name , test ) )