@@ -115,16 +115,16 @@ def function_that_takes_theme_params(logo=None, color=''):
115115
116116
117117def test_process_theme_params_right_path ():
118- with get_temporary_logo () as path_to_logo :
119- with open (path_to_logo , 'rb' ) as logo :
120- encoded_logo = base64 .b64encode (logo .read ())
118+ path_to_logo = get_temporary_logo ()
119+ with open (path_to_logo , 'rb' ) as logo :
120+ encoded_logo = base64 .b64encode (logo .read ())
121121
122- @process_theme_params
123- def function_that_takes_theme_params (logo = None , color = '' ):
124- assert logo == encoded_logo
125- assert color == '#eeff00'
122+ @process_theme_params
123+ def function_that_takes_theme_params (logo = None , color = '' ):
124+ assert logo == encoded_logo
125+ assert color == '#eeff00'
126126
127- function_that_takes_theme_params (logo = path_to_logo , color = 'eeff00' )
127+ function_that_takes_theme_params (logo = path_to_logo , color = 'eeff00' )
128128
129129
130130def test_process_theme_params_logo_from_txt ():
@@ -142,14 +142,14 @@ def test_process_theme_params_logo_from_url():
142142 responses .add (responses .HEAD ,
143143 'http://somehost.no/rand_logo.png' ,
144144 status = 200 )
145- with get_temporary_logo () as path :
146- with open (path , 'rb' ) as logo :
147- responses .add (responses .GET ,
148- 'http://somehost.no/rand_logo.png' ,
149- content_type = 'image/png' ,
150- stream = True ,
151- body = logo .read (),
152- status = 200 )
145+ path = get_temporary_logo ()
146+ with open (path , 'rb' ) as logo :
147+ responses .add (responses .GET ,
148+ 'http://somehost.no/rand_logo.png' ,
149+ content_type = 'image/png' ,
150+ stream = True ,
151+ body = logo .read (),
152+ status = 200 )
153153
154154 @process_theme_params
155155 def function_that_takes_theme_params (logo = None , color = '' ):
0 commit comments