mirror of
https://github.com/progval/irctest.git
synced 2025-04-05 06:49:47 +00:00
Make the dependency on ecdsa optional
This commit is contained in:
@ -1,7 +1,12 @@
|
|||||||
import base64
|
import base64
|
||||||
|
|
||||||
import ecdsa
|
import pytest
|
||||||
from ecdsa.util import sigdecode_der
|
|
||||||
|
try:
|
||||||
|
import ecdsa
|
||||||
|
from ecdsa.util import sigdecode_der
|
||||||
|
except ImportError:
|
||||||
|
ecdsa = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import pyxmpp2_scram as scram
|
import pyxmpp2_scram as scram
|
||||||
@ -144,6 +149,7 @@ class SaslTestCase(
|
|||||||
m = self.negotiateCapabilities(["sasl"], False)
|
m = self.negotiateCapabilities(["sasl"], False)
|
||||||
self.assertEqual(m, Message({}, None, "CAP", ["END"]))
|
self.assertEqual(m, Message({}, None, "CAP", ["END"]))
|
||||||
|
|
||||||
|
@pytest.mark.skipif(ecdsa is None, reason="python3-ecdsa is not available")
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("ECDSA-NIST256P-CHALLENGE")
|
@cases.OptionalityHelper.skipUnlessHasMechanism("ECDSA-NIST256P-CHALLENGE")
|
||||||
def testEcdsa(self):
|
def testEcdsa(self):
|
||||||
"""Test ECDSA authentication."""
|
"""Test ECDSA authentication."""
|
||||||
|
Reference in New Issue
Block a user