From 5dac84c3c882ee42bc541042684de18d7166fdd3 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 15 Jun 2023 15:49:32 +0530 Subject: refactor: consistently adopt PGP over GPG for naming PGP is the standard, GPG is an implementation of it. We're adhering to PGP, and not using GPG. --- .../app/passwordstore/crypto/GpgIdentifierTest.kt | 41 ---------------------- .../app/passwordstore/crypto/KeyUtilsTest.kt | 2 +- .../app/passwordstore/crypto/PGPIdentifierTest.kt | 41 ++++++++++++++++++++++ .../app/passwordstore/crypto/PGPKeyManagerTest.kt | 4 +-- 4 files changed, 44 insertions(+), 44 deletions(-) delete mode 100644 crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/GpgIdentifierTest.kt create mode 100644 crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPIdentifierTest.kt (limited to 'crypto-pgpainless/src/test') diff --git a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/GpgIdentifierTest.kt b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/GpgIdentifierTest.kt deleted file mode 100644 index 009976a2..00000000 --- a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/GpgIdentifierTest.kt +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright © 2014-2022 The Android Password Store Authors. All Rights Reserved. - * SPDX-License-Identifier: GPL-3.0-only - */ - -package app.passwordstore.crypto - -import kotlin.test.Test -import kotlin.test.assertNotNull -import kotlin.test.assertTrue - -class GpgIdentifierTest { - - @Test - fun parseHexKeyIdWithout0xPrefix() { - val identifier = GpgIdentifier.fromString("79E8208280490C77") - assertNotNull(identifier) - assertTrue { identifier is GpgIdentifier.KeyId } - } - - @Test - fun parseHexKeyId() { - val identifier = GpgIdentifier.fromString("0x79E8208280490C77") - assertNotNull(identifier) - assertTrue { identifier is GpgIdentifier.KeyId } - } - - @Test - fun parseValidEmail() { - val identifier = GpgIdentifier.fromString("john.doe@example.org") - assertNotNull(identifier) - assertTrue { identifier is GpgIdentifier.UserId } - } - - @Test - fun parseEmailWithoutTLD() { - val identifier = GpgIdentifier.fromString("john.doe@example") - assertNotNull(identifier) - assertTrue { identifier is GpgIdentifier.UserId } - } -} diff --git a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt index f7bf46d9..39af53b1 100644 --- a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt +++ b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt @@ -18,7 +18,7 @@ class KeyUtilsTest { assertIs(keyring) val keyId = tryGetId(key) assertNotNull(keyId) - assertIs(keyId) + assertIs(keyId) assertEquals("b950ae2813841585", keyId.toString()) } } diff --git a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPIdentifierTest.kt b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPIdentifierTest.kt new file mode 100644 index 00000000..efc6e0ba --- /dev/null +++ b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPIdentifierTest.kt @@ -0,0 +1,41 @@ +/* + * Copyright © 2014-2022 The Android Password Store Authors. All Rights Reserved. + * SPDX-License-Identifier: GPL-3.0-only + */ + +package app.passwordstore.crypto + +import kotlin.test.Test +import kotlin.test.assertNotNull +import kotlin.test.assertTrue + +class PGPIdentifierTest { + + @Test + fun parseHexKeyIdWithout0xPrefix() { + val identifier = PGPIdentifier.fromString("79E8208280490C77") + assertNotNull(identifier) + assertTrue { identifier is PGPIdentifier.KeyId } + } + + @Test + fun parseHexKeyId() { + val identifier = PGPIdentifier.fromString("0x79E8208280490C77") + assertNotNull(identifier) + assertTrue { identifier is PGPIdentifier.KeyId } + } + + @Test + fun parseValidEmail() { + val identifier = PGPIdentifier.fromString("john.doe@example.org") + assertNotNull(identifier) + assertTrue { identifier is PGPIdentifier.UserId } + } + + @Test + fun parseEmailWithoutTLD() { + val identifier = PGPIdentifier.fromString("john.doe@example") + assertNotNull(identifier) + assertTrue { identifier is PGPIdentifier.UserId } + } +} diff --git a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPKeyManagerTest.kt b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPKeyManagerTest.kt index c8bd66c5..43a62bd7 100644 --- a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPKeyManagerTest.kt +++ b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPKeyManagerTest.kt @@ -1,8 +1,8 @@ package app.passwordstore.crypto -import app.passwordstore.crypto.GpgIdentifier.KeyId -import app.passwordstore.crypto.GpgIdentifier.UserId import app.passwordstore.crypto.KeyUtils.tryGetId +import app.passwordstore.crypto.PGPIdentifier.KeyId +import app.passwordstore.crypto.PGPIdentifier.UserId import app.passwordstore.crypto.errors.KeyAlreadyExistsException import app.passwordstore.crypto.errors.KeyNotFoundException import app.passwordstore.crypto.errors.NoKeysAvailableException -- cgit v1.2.3