

def testUpdateMissingKey(self):
    fingerprint = '95B457D16843B21EA3FC73BBC7C32FC1F94E405E'
    keyCache = openpgpkey.getKeyCache()
    keyCache.getPrivateKey(fingerprint, '111111')
    self.cfg.signatureKey = fingerprint
    self.addQuickTestComponent('test:doc', '1.0-1-1')
    signtrove.signTroves(self.cfg, ['test:doc'])
    repos = self.openRepository()
    newKeyCache = openpgpkey.OpenPGPKeyFileCache()
    tmpPath = mkdtemp()
    pubRing = self.cfg.pubRing
    self.cfg.pubRing = [(tmpPath + '/pubring.gpg')]
    newKeyCache.publicPaths = self.cfg.pubRing
    keyCacheCallback = openpgpkey.KeyCacheCallback(repos, self.cfg)
    newKeyCache.setCallback(keyCacheCallback)
    openpgpkey.setKeyCache(newKeyCache)
    try:
        self.updatePkg(self.rootDir, 'test:doc')
        newKeyCache.getPublicKey(keyCacheCallback)
    finally:
        self.cfg.pubRing = pubRing
        openpgpkey.setKeyCache(keyCache)
    util.rmtree(tmpPath)

dataset/ETHPy150Open sassoftware/conary/conary_test/cvctest/sigtest.py SigTest.testUpdateMissingKey/VarMisuse@161/283 `fingerprint`->`keyCacheCallback`