#NEWLINE# def test_cleanup_extract( self ) : #NEWLINE# #INDENT# cleanup_args = [ None ] #NEWLINE# extract_args = [ None ] #NEWLINE# def cleanup( x ) : #NEWLINE# #INDENT# self . assertIsNone ( cleanup_args [ 0 ] ) #NEWLINE# cleanup_args [ 0 ] = x #NEWLINE# return 'TESTed' #NEWLINE# #UNINDENT# def extract( x ) : #NEWLINE# #INDENT# self . assertIsNone ( extract_args [ 0 ] ) #NEWLINE# extract_args [ 0 ] = x #NEWLINE# return 'Xtracted' #NEWLINE# #UNINDENT# class Page ( BasePage ) : #NEWLINE# #INDENT# foo = livescrape . Css ( 'h1.foo' , cleanup = cleanup , extract = extract ) #NEWLINE# #UNINDENT# x = Page ( ) #NEWLINE# value = x . foo #NEWLINE# self . assertEqual ( extract_args [ 0 ] . text , 'Heading' ) #NEWLINE# self . assertEqual ( self [ 0 ] , 'Xtracted' ) #NEWLINE# self . assertEqual ( value , 'TESTed' )