#NEWLINE# def test_allowed_css( ) : #NEWLINE# #INDENT# tests = ( ( 'font-family: Arial; color: red; float: left; background-color: red;' , 'color: red;' , [ 'color' ] ) , ( 'border: 1px solid blue; color: red; float: left;' , 'color: red;' , [ 'color' ] ) , ( 'border: 1px solid blue; color: red; float: left;' , 'color: red; float: left;' , [ 'color' , 'float' ] ) , ( 'color: red; float: left; padding: 1em;' , 'color: red; float: left;' , [ 'color' , 'float' ] ) , ( 'color: red; float: left; padding: 1em;' , 'color: red;' , [ 'color' ] ) , ( 'cursor: -moz-grab;' , 'cursor: -moz-grab;' , [ 'cursor' ] ) , ( 'color: hsl(30,100%,50%);' , 'color: hsl(30,100%,50%);' , [ 'color' ] ) , ( 'color: rgba(255,0,0,0.4);' , 'color: rgba(255,0,0,0.4);' , [ 'color' ] ) , ( "text-overflow: ',' ellipsis;" , "text-overflow: ',' ellipsis;" , [ 'text-overflow' ] ) , ( 'text-overflow: "," ellipsis;' , 'text-overflow: "," ellipsis;' , [ 'text-overflow' ] ) , ( 'font-family: "Arial";' , 'font-family: "Arial";' , [ 'font-family' ] ) ) #NEWLINE# p_single = '<p style="{0!s}">bar</p>' #NEWLINE# p_double = "<p style='{0!s}'>bar</p>" #NEWLINE# def check( i , o , s ) : #NEWLINE# #INDENT# if ( '"' in i ) : #NEWLINE# #INDENT# eq_ ( p_double . format ( o ) , clean ( p_double . format ( i ) , styles = s ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# eq_ ( p_single . format ( o ) , clean ( p_single . format ( i ) , styles = s ) ) #NEWLINE# #UNINDENT# #UNINDENT# for ( i , o , s ) in tests : #NEWLINE# #INDENT# ( yield ( check , i , o , s ) )