#NEWLINE# def test_extract( self ) : #NEWLINE# #INDENT# blank = 'http://fapp.io/foo/' #NEWLINE# frame = 'test %s\n%s\n%s\n%s at last' #NEWLINE# frame_html = '<p>test %s</p><p><a href="foo">%s</a> %s</p><p>%s</p>' #NEWLINE# for ( url , expected ) in self . data_pairs . items ( ) : #NEWLINE# #INDENT# ( all_urls , extracted ) = extract ( ( frame % ( url , blank , url , blank ) ) , test_pr ) #NEWLINE# self . assertEqual ( all_urls , [ url , url ] ) #NEWLINE# if ( 'url' not in expected ) : #NEWLINE# #INDENT# expected [ 'url' ] = url #NEWLINE# #UNINDENT# if ( 'title' not in expected ) : #NEWLINE# #INDENT# expected [ 'title' ] = expected [ 'url' ] #NEWLINE# #UNINDENT# self . assertEqual ( extracted , { #NEWLINE# #INDENT# url : expected , #NEWLINE# #UNINDENT# } ) #NEWLINE# ( all_urls , extracted ) = extract_html ( ( frame_html % ( url , url , blank , blank ) ) , test_pr ) #NEWLINE# self . assertEqual ( all_urls , [ url , blank ] ) #NEWLINE# if ( 'url' not in expected ) : #NEWLINE# #INDENT# expected [ 'url' ] = url #NEWLINE# #UNINDENT# self . assertEqual ( extracted , { #NEWLINE# #INDENT# url : expected , #NEWLINE# #UNINDENT# } )