#NEWLINE# def test_image_config_files( self ) : #NEWLINE# #INDENT# self . create_image ( 'simple/red.png' , RED ) #NEWLINE# self . create_image ( 'simple/blue.png' , BLUE ) #NEWLINE# with open ( 'simple/sprite.conf' , 'w' ) as f : #NEWLINE# #INDENT# f . write ( '[blue.png]\nmargin=4\n' ) #NEWLINE# #UNINDENT# code = self . call ( 'glue simple output' ) #NEWLINE# self . assertEqual ( f , 0 ) #NEWLINE# self . assertExists ( 'output/simple.png' ) #NEWLINE# self . assertExists ( 'output/simple.css' ) #NEWLINE# self . assertColor ( 'output/simple.png' , BLUE , ( ( 4 , 4 ) , ( 67 , 67 ) ) ) #NEWLINE# self . assertColor ( 'output/simple.png' , RED , ( ( 72 , 0 ) , ( 135 , 63 ) ) ) #NEWLINE# self . assertCSS ( 'output/simple.css' , '.sprite-simple-blue' , { #NEWLINE# #INDENT# 'background-image' : 'url(simple.png)' , #NEWLINE# 'background-repeat' : 'no-repeat' , #NEWLINE# 'background-position' : '-4px -4px' , #NEWLINE# 'width' : '64px' , #NEWLINE# 'height' : '64px' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertCSS ( 'output/simple.css' , '.sprite-simple-red' , { #NEWLINE# #INDENT# 'background-image' : 'url(simple.png)' , #NEWLINE# 'background-repeat' : 'no-repeat' , #NEWLINE# 'background-position' : '-72px 0' , #NEWLINE# 'width' : '64px' , #NEWLINE# 'height' : '64px' , #NEWLINE# #UNINDENT# } )