#NEWLINE# def test_repr( ) : #NEWLINE# #INDENT# 'Verify that __repr__ returns valid Python expressions' #NEWLINE# match = Match ( 'a pattern' , msg = 'message' ) #NEWLINE# replace = Replace ( 'you' , 'I' , msg = 'you and I' ) #NEWLINE# range_ = Range ( min = 0 , max = 42 , min_included = False , max_included = False , msg = 'number not in range' ) #NEWLINE# coerce_ = Coerce ( int , msg = 'moo' ) #NEWLINE# all_ = All ( '10' , Coerce ( int ) , msg = 'all msg' ) #NEWLINE# assert_equal ( repr ( match ) , "Match('a pattern', msg='message')" ) #NEWLINE# assert_equal ( repr ( replace ) , "Replace('you', 'I', msg='you and I')" ) #NEWLINE# assert_equal ( repr ( range_ ) , "Range(min=0, max=42, min_included=False, max_included=False, msg='number not in range')" ) #NEWLINE# assert_equal ( repr ( coerce_ ) , "Coerce(int, msg='moo')" ) #NEWLINE# assert_equal ( repr ( all_ ) , "All('10', Coerce(int, msg=None), msg='all msg')" )