

def testSignedCheckout(self):
    fingerprint = 'F7440D78FE813C882212C2BF8AC2828190B1E477'
    keyCache = openpgpkey.getKeyCache()
    keyCache.getPrivateKey(fingerprint, '111111')
    self.addQuickTestComponent('test:source', '1.0-1-1')
    self.cfg.signatureKey = fingerprint
    self.cfg.quiet = True
    keyRing = open(resources.get_path('conary_test', 'archive', 'pubring.gpg'))
    keyData = openpgpfile.exportKey(fingerprint, keyRing)
    keyData.seek(0)
    keyData = keyData.read()
    repos = self.openRepository()
    repos.addNewPGPKey(self.cfg.buildLabel, 'test', keyData)
    signtrove.signTroves(self.cfg, ['test:source'])
    pubKey = keyCache.getPublicKey(fingerprint)
    pubKey.trustLevel = openpgpfile.TRUST_UNTRUSTED
    keyCache.publicDict[fingerprint] = pubKey
    self.cfg.trustThreshold = openpgpfile.TRUST_ULTIMATE
    keyRing.logFilter.add()
    try:
        checkout(repos, self.cfg, self.workDir, ['test'])
        self.fail('checkin.checkout did not properly verify trust levels')
    except DigitalSignatureVerificationError:
        self.logFilter.compare(['warning: The trove test:source has signatures generated with untrusted keys. You can either resign the trove with a key that you trust, or add one of the keys to the list of trusted keys (the trustedKeys configuration option). The keys that were not trusted are: 90B1E477'])

dataset/ETHPy150Open sassoftware/conary/conary_test/cvctest/sigtest.py SigTest.testSignedCheckout/VarMisuse@170/290 `self`->`keyRing`