def delete(self): self._checkState() op = pureldap.LDAPDelRequest(entry=self.dn.getText()) d = self.client.send(op) d.addCallback(self._cbDeleteDone) self._state = 'deleted' return d
def test_delete(self): self.server.dataReceived( pureldap.LDAPMessage(pureldap.LDAPDelRequest(self.thingie.dn), id=2).toWire()) self.assertEqual( self.server.transport.value(), pureldap.LDAPMessage(pureldap.LDAPDelResponse(resultCode=0), id=2).toWire()) d = self.stuff.children() d.addCallback( lambda actual: six.assertCountEqual(self, actual, [self.another])) return d
def test_delete(self): self.server.dataReceived( str( pureldap.LDAPMessage(pureldap.LDAPDelRequest( str(self.thingie.dn)), id=2))) self.assertEquals( self.server.transport.value(), str( pureldap.LDAPMessage(pureldap.LDAPDelResponse(resultCode=0), id=2))) d = self.stuff.children() d.addCallback(self.assertItemsEqual, [self.another]) return d