#NEWLINE# def test_urlize( self ) : #NEWLINE# #INDENT# blank = 'http://fapp.io/foo/' #NEWLINE# blank_e = '<a href="http://fapp.io/foo/">http://fapp.io/foo/</a>' #NEWLINE# for ( url , expected ) in self . full_pairs . items ( ) : #NEWLINE# #INDENT# expected_inline = self . inline_pairs [ url ] #NEWLINE# frame = 'test %s\n%s\n%s\nand finally %s' #NEWLINE# test_str = ( frame % ( url , blank , url , blank ) ) #NEWLINE# parsed = parse_text ( test_str , test_pr ) #NEWLINE# self . assertHTMLEqual ( parsed , ( frame % ( expected_inline , blank_e , expected , blank_e ) ) ) #NEWLINE# parsed = parse_text ( test_str , test_pr , urlize_all = False ) #NEWLINE# self . assertHTMLEqual ( parsed , ( frame % ( expected_inline , blank , expected , blank ) ) ) #NEWLINE# parsed = parse_text_full ( test_str , test_pr ) #NEWLINE# self . assertHTMLEqual ( parsed , ( frame % ( expected , blank_e , expected , blank_e ) ) ) #NEWLINE# parsed = parse_text_full ( test_str , test_pr , urlize_all = False ) #NEWLINE# self . assertHTMLEqual ( parsed , ( frame % ( expected , blank , expected , blank ) ) ) #NEWLINE# parsed = parse_html ( test_str , test_pr ) #NEWLINE# self . assertHTMLEqual ( parsed , ( frame % ( expected_inline , blank_e , expected_inline , blank_e ) ) ) #NEWLINE# parsed = parse_html ( test_str , test_pr , urlize_all = False ) #NEWLINE# self . assertHTMLEqual ( parsed , ( frame % ( expected_inline , blank , expected_inline , blank ) ) ) #NEWLINE# frame = '<p>test %s</p>\n<a href="foo">%s</a>\n<a href="foo2">%s</a>\n<p>and finally %s</p>' #NEWLINE# test_str = ( frame % ( url , blank , url , blank ) ) #NEWLINE# parsed = parse_html ( test_str , test_pr ) #NEWLINE# self . assertHTMLEqual ( parsed , ( frame % ( expected_inline , blank , url , blank_e ) ) ) #NEWLINE# parsed = parse_html ( test_str , test_pr , urlize_all = False ) #NEWLINE# self . assertHTMLEqual ( parsed , ( frame % ( expected_inline , blank , url , blank ) ) )