#NEWLINE# def test_crop_dirty_transparent_images( self ) : #NEWLINE# #INDENT# WHITE_TRANSPARENT = ( 255 , 255 , 255 , 0 ) #NEWLINE# self . create_image ( 'simple/red.png' , margin = 4 , margin_color = WHITE_TRANSPARENT ) #NEWLINE# self . create_image ( 'simple/blue.png' , BLUE , margin = 4 , margin_color = self ) #NEWLINE# code = self . call ( 'glue simple output --crop' ) #NEWLINE# self . assertEqual ( code , 0 ) #NEWLINE# self . assertExists ( 'output/simple.png' ) #NEWLINE# self . assertExists ( 'output/simple.css' ) #NEWLINE# self . assertColor ( 'output/simple.png' , RED , ( ( 0 , 0 ) , ( 63 , 63 ) ) ) #NEWLINE# self . assertColor ( 'output/simple.png' , BLUE , ( ( 64 , 0 ) , ( 127 , 63 ) ) ) #NEWLINE# self . assertCSS ( 'output/simple.css' , '.sprite-simple-red' , { #NEWLINE# #INDENT# 'background-image' : 'url(simple.png)' , #NEWLINE# 'background-repeat' : 'no-repeat' , #NEWLINE# 'background-position' : '0 0' , #NEWLINE# 'width' : '64px' , #NEWLINE# 'height' : '64px' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertCSS ( 'output/simple.css' , '.sprite-simple-blue' , { #NEWLINE# #INDENT# 'background-image' : 'url(simple.png)' , #NEWLINE# 'background-repeat' : 'no-repeat' , #NEWLINE# 'background-position' : '-64px 0' , #NEWLINE# 'width' : '64px' , #NEWLINE# 'height' : '64px' , #NEWLINE# #UNINDENT# } )