#NEWLINE# def test_clear( self ) : #NEWLINE# #INDENT# ROLE1 = 'role1' #NEWLINE# ROLE2 = 'role2' #NEWLINE# STICKY = { #NEWLINE# #INDENT# 'entity' : 'allUsers' , #NEWLINE# 'role' : ROLE2 , #NEWLINE# #UNINDENT# } #NEWLINE# connection = _Connection ( { #NEWLINE# #INDENT# 'acl' : [ STICKY ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# client = _Client ( self ) #NEWLINE# acl = self . _makeOne ( ) #NEWLINE# acl . save_path = '/testing' #NEWLINE# acl . loaded = True #NEWLINE# acl . entity ( 'allUsers' , ROLE1 ) #NEWLINE# acl . clear ( client = client ) #NEWLINE# self . assertEqual ( list ( acl ) , [ STICKY ] ) #NEWLINE# kw = connection . _requested #NEWLINE# self . assertEqual ( len ( kw ) , 1 ) #NEWLINE# self . assertEqual ( kw [ 0 ] [ 'method' ] , 'PATCH' ) #NEWLINE# self . assertEqual ( kw [ 0 ] [ 'path' ] , '/testing' ) #NEWLINE# self . assertEqual ( kw [ 0 ] [ 'data' ] , { #NEWLINE# #INDENT# 'acl' : [ ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( kw [ 0 ] [ 'query_params' ] , { #NEWLINE# #INDENT# 'projection' : 'full' , #NEWLINE# #UNINDENT# } )