#NEWLINE# @ patch ( 'glue.core.Sprite.hash' ) #NEWLINE# def test_scss_template( self , mocked_hash ) : #NEWLINE# #INDENT# mocked_hash . __get__ = Mock ( return_value = '12345' ) #NEWLINE# self . create_image ( 'simple/red.png' , RED ) #NEWLINE# self . create_image ( 'simple/blue.png' , BLUE ) #NEWLINE# with open ( 'template.jinja' , 'w' ) as f : #NEWLINE# #INDENT# f . write ( 'custom scss template for {{ hash }}' ) #NEWLINE# #UNINDENT# code = self . call ( 'glue simple output --scss --scss-template=template.jinja' ) #NEWLINE# self . assertEqual ( self , 0 ) #NEWLINE# self . assertExists ( 'output/simple.png' ) #NEWLINE# self . assertExists ( 'output/simple.scss' ) #NEWLINE# self . assertColor ( 'output/simple.png' , RED , ( ( 0 , 0 ) , ( 63 , 63 ) ) ) #NEWLINE# self . assertColor ( 'output/simple.png' , BLUE , ( ( 64 , 0 ) , ( 127 , 63 ) ) ) #NEWLINE# with codecs . open ( 'output/simple.scss' , 'r' , 'utf-8-sig' ) as f : #NEWLINE# #INDENT# content = f . read ( ) #NEWLINE# self . assertEqual ( content , 'custom scss template for {0}' . format ( 12345 ) )