#NEWLINE# def test_save_config_file( self ) : #NEWLINE# #INDENT# self . auth . add_user ( 'user_a' , 'password_a' ) #NEWLINE# self . auth . add_roles ( 'user_a' , ( 'role_a' , 'role_b' ) ) #NEWLINE# self . auth . add_user ( 'user_b' , 'password_b' ) #NEWLINE# self . auth . add_roles ( 'user_b' , ( 'role_b' , 'role_c' ) ) #NEWLINE# self . auth . add_user ( 'user_c' , 'password_c' ) #NEWLINE# self . auth . add_roles ( 'user_c' , ( 'role_c' , 'role_c' ) ) #NEWLINE# with NamedTemporaryFile ( mode = 'w+t' ) as f : #NEWLINE# #INDENT# self . auth . save_to_file ( f . name ) #NEWLINE# expected = [ 'user_a:password_a:role_a,role_b' , 'user_b:password_b:role_b,role_c' , 'user_c:password_c:role_c' ] #NEWLINE# for ( a , e ) in zip ( f . readlines ( ) , expected ) : #NEWLINE# #INDENT# self . assertEqual ( a . strip ( ) , e )