func assertKeysMissing(t *testing.T, gpgClient *libkb.GpgCLI, fingerprints []string) { for _, fingerprint := range fingerprints { _, err := gpgClient.ImportKey(false /*secret*/, *libkb.PGPFingerprintFromHexNoError(fingerprint)) if err == nil { t.Fatal("Should not already have fingerprint in keyring:", fingerprint) } } }
func assertKeysPresent(t *testing.T, gpgClient *libkb.GpgCLI, fingerprints []string) { for _, fingerprint := range fingerprints { fpObj, err := gpgClient.ImportKey(false /*secret*/, *libkb.PGPFingerprintFromHexNoError(fingerprint)) if err != nil { t.Fatal("Should have fingerprint in keyring:", fingerprint) } if fingerprint != fpObj.GetFingerprint().String() { t.Fatal("Expected to import a different fingerprint:", fingerprint, fpObj.GetFingerprint()) } } }