def testRid(self):
        """Test that rid field is updated based on uidNumber."""
        client = testutil.LDAPClientTestDriver()
        o=ldapsyntax.LDAPEntryWithAutoFill(client=client,
                                           dn='cn=foo,dc=example,dc=com',
                                           attributes={
            'objectClass': ['sambaAccount', 'other'],
            })
        d = o.addAutofiller(sambaAccount.Autofill_samba())
        def cb(dummy):
            client.assertNothingSent()

            o['uidNumber'] = ['1000']
            self.failUnless('rid' in o)
            self.failUnlessEqual(o['rid'], [str(2*1000+1000)])
            o['uidNumber'] = ['1001']
            self.failUnlessEqual(o['rid'], [str(2*1001+1000)])
            o['uidNumber'] = ['1002']
            self.failUnlessEqual(o['rid'], [str(2*1002+1000)])
            o['uidNumber'] = ['2000']
            self.failUnlessEqual(o['rid'], [str(2*2000+1000)])
            o['uidNumber'] = ['3000']
            self.failUnlessEqual(o['rid'], [str(2*3000+1000)])
            o['uidNumber'] = ['0']
            self.failUnlessEqual(o['rid'], [str(2*0+1000)])
            o['uidNumber'] = ['16000']
            self.failUnlessEqual(o['rid'], [str(2*16000+1000)])
        d.addCallback(cb)
        return d
dataset/ETHPy150Open antong/ldaptor/ldaptor/test/test_autofill_samba.py/LDAPAutoFill_sambaAccount.testRid/original