#NEWLINE# def test_patch( self ) : #NEWLINE# #INDENT# connection = _Connection ( { #NEWLINE# #INDENT# 'foo' : 'Foo' , #NEWLINE# #UNINDENT# } ) #NEWLINE# client = _Client ( connection ) #NEWLINE# derived = self . _derivedClass ( '/path' ) ( ) #NEWLINE# BAR = object ( ) #NEWLINE# BAZ = object ( ) #NEWLINE# derived . _properties = { #NEWLINE# #INDENT# 'bar' : BAR , #NEWLINE# 'baz' : BAZ , #NEWLINE# #UNINDENT# } #NEWLINE# derived . _changes = set ( [ 'bar' ] ) #NEWLINE# derived . patch ( client = client ) #NEWLINE# self . assertEqual ( derived . _properties , { #NEWLINE# #INDENT# 'foo' : 'Foo' , #NEWLINE# #UNINDENT# } ) #NEWLINE# kw = connection . _requested #NEWLINE# self . assertEqual ( len ( kw ) , 1 ) #NEWLINE# self . assertEqual ( kw [ 0 ] [ 'method' ] , 'PATCH' ) #NEWLINE# self . assertEqual ( kw [ 0 ] [ 'path' ] , '/path' ) #NEWLINE# self . assertEqual ( kw [ 0 ] [ 'query_params' ] , { #NEWLINE# #INDENT# 'projection' : 'full' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( kw [ 0 ] [ 'data' ] , { #NEWLINE# #INDENT# 'bar' : BAR , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( derived . _changes , set ( ) )