|
@@ -80,6 +80,11 @@ class GPGSignatureVendorTests(unittest.TestCase):
|
|
|
vendor = GPGSignatureVendor()
|
|
vendor = GPGSignatureVendor()
|
|
|
self.assertIsNone(vendor.min_trust_level)
|
|
self.assertIsNone(vendor.min_trust_level)
|
|
|
|
|
|
|
|
|
|
+ def test_available(self) -> None:
|
|
|
|
|
+ """Test that available() returns boolean."""
|
|
|
|
|
+ result = GPGSignatureVendor.available()
|
|
|
|
|
+ self.assertIsInstance(result, bool)
|
|
|
|
|
+
|
|
|
def test_sign_and_verify(self) -> None:
|
|
def test_sign_and_verify(self) -> None:
|
|
|
"""Test basic sign and verify cycle.
|
|
"""Test basic sign and verify cycle.
|
|
|
|
|
|
|
@@ -282,6 +287,11 @@ class GPGCliSignatureVendorTests(unittest.TestCase):
|
|
|
vendor = GPGCliSignatureVendor(config=config)
|
|
vendor = GPGCliSignatureVendor(config=config)
|
|
|
self.assertEqual(vendor.gpg_command, "gpg")
|
|
self.assertEqual(vendor.gpg_command, "gpg")
|
|
|
|
|
|
|
|
|
|
+ def test_available(self) -> None:
|
|
|
|
|
+ """Test that available() returns boolean."""
|
|
|
|
|
+ result = GPGCliSignatureVendor.available()
|
|
|
|
|
+ self.assertIsInstance(result, bool)
|
|
|
|
|
+
|
|
|
|
|
|
|
|
class X509SignatureVendorTests(unittest.TestCase):
|
|
class X509SignatureVendorTests(unittest.TestCase):
|
|
|
"""Tests for X509SignatureVendor."""
|
|
"""Tests for X509SignatureVendor."""
|
|
@@ -313,6 +323,11 @@ class X509SignatureVendorTests(unittest.TestCase):
|
|
|
vendor = X509SignatureVendor(config=config)
|
|
vendor = X509SignatureVendor(config=config)
|
|
|
self.assertEqual(vendor.gpgsm_command, "gpgsm")
|
|
self.assertEqual(vendor.gpgsm_command, "gpgsm")
|
|
|
|
|
|
|
|
|
|
+ def test_available(self) -> None:
|
|
|
|
|
+ """Test that available() returns boolean."""
|
|
|
|
|
+ result = X509SignatureVendor.available()
|
|
|
|
|
+ self.assertIsInstance(result, bool)
|
|
|
|
|
+
|
|
|
@unittest.skipIf(
|
|
@unittest.skipIf(
|
|
|
shutil.which("gpgsm") is None, "gpgsm command not available in PATH"
|
|
shutil.which("gpgsm") is None, "gpgsm command not available in PATH"
|
|
|
)
|
|
)
|
|
@@ -430,6 +445,11 @@ class SSHSigSignatureVendorTests(unittest.TestCase):
|
|
|
self.assertEqual(vendor.allowed_signers_file, "/path/to/allowed")
|
|
self.assertEqual(vendor.allowed_signers_file, "/path/to/allowed")
|
|
|
self.assertEqual(vendor.default_key_command, "ssh-add -L")
|
|
self.assertEqual(vendor.default_key_command, "ssh-add -L")
|
|
|
|
|
|
|
|
|
|
+ def test_available(self) -> None:
|
|
|
|
|
+ """Test that available() returns boolean."""
|
|
|
|
|
+ result = SSHSigSignatureVendor.available()
|
|
|
|
|
+ self.assertIsInstance(result, bool)
|
|
|
|
|
+
|
|
|
def test_verify_with_cli_generated_signature(self) -> None:
|
|
def test_verify_with_cli_generated_signature(self) -> None:
|
|
|
"""Test verifying a signature created by SSH CLI vendor."""
|
|
"""Test verifying a signature created by SSH CLI vendor."""
|
|
|
import os
|
|
import os
|
|
@@ -640,6 +660,11 @@ class SSHCliSignatureVendorTests(unittest.TestCase):
|
|
|
vendor = SSHCliSignatureVendor(config=config)
|
|
vendor = SSHCliSignatureVendor(config=config)
|
|
|
self.assertEqual(vendor.revocation_file, "/path/to/revoked_keys")
|
|
self.assertEqual(vendor.revocation_file, "/path/to/revoked_keys")
|
|
|
|
|
|
|
|
|
|
+ def test_available(self) -> None:
|
|
|
|
|
+ """Test that available() returns boolean."""
|
|
|
|
|
+ result = SSHCliSignatureVendor.available()
|
|
|
|
|
+ self.assertIsInstance(result, bool)
|
|
|
|
|
+
|
|
|
|
|
|
|
|
class DetectSignatureFormatTests(unittest.TestCase):
|
|
class DetectSignatureFormatTests(unittest.TestCase):
|
|
|
"""Tests for detect_signature_format function."""
|
|
"""Tests for detect_signature_format function."""
|