#NEWLINE# def testRemovingRDNFails( self ) : #NEWLINE# #INDENT# 'Removing RDN fails with CannotRemoveRDNError.' #NEWLINE# o = ldapsyntax . LDAPEntry ( client = None , dn = 'cn=foo,dc=example,dc=com' , attributes = { #NEWLINE# #INDENT# 'objectClass' : [ 'someObjectClass' ] , #NEWLINE# 'cn' : [ 'foo' , 'bar' , 'baz' ] , #NEWLINE# 'a' : [ 'aValue' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# o [ 'cn' ] . remove ( 'bar' ) #NEWLINE# del o [ 'a' ] #NEWLINE# self . assertRaises ( ldapsyntax . CannotRemoveRDNError , o [ 'cn' ] . remove , 'foo' ) #NEWLINE# def f( ) : #NEWLINE# #INDENT# del o [ 'cn' ] #NEWLINE# #UNINDENT# self . assertRaises ( ldapsyntax . CannotRemoveRDNError , f ) #NEWLINE# def f( ) : #NEWLINE# #INDENT# o [ 'cn' ] = [ 'thud' ] #NEWLINE# #UNINDENT# self . assertRaises ( ldapsyntax . CannotRemoveRDNError , f ) #NEWLINE# def f( ) : #NEWLINE# #INDENT# o [ 'cn' ] = [ 'foo' ] #NEWLINE# #UNINDENT# self . assertRaises ( ldapsyntax . CannotRemoveRDNError , f )