Updated test for auth_plugins to skip Httpasswd when libpass is not available
This commit is contained in:
parent
6e95468714
commit
27f38cc2e3
|
|
@ -3,5 +3,5 @@ nose2
|
||||||
six
|
six
|
||||||
redis
|
redis
|
||||||
wrapt<=1.12.1;python_version<="3.4"
|
wrapt<=1.12.1;python_version<="3.4"
|
||||||
libpass
|
libpass;python_versions>="3.8"
|
||||||
bcrypt
|
bcrypt;python_versions>="3.8"
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,13 @@ class BasicHTTPAuthTestCase(unittest.TestCase):
|
||||||
headers = {'Authorization': 'Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxx'}
|
headers = {'Authorization': 'Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxx'}
|
||||||
self.assertRaises(AuthenticationError, self.plugin.authenticate, headers, 'localhost', '1234')
|
self.assertRaises(AuthenticationError, self.plugin.authenticate, headers, 'localhost', '1234')
|
||||||
|
|
||||||
|
try:
|
||||||
|
import passlib
|
||||||
|
PASSLIB_AVAILABLE = True
|
||||||
|
except ImportError:
|
||||||
|
PASSLIB_AVAILABLE = False
|
||||||
|
|
||||||
|
@unittest.skipUnless(PASSLIB_AVAILABLE, "passlib package is not available")
|
||||||
class HtpasswdAuthTestCase(unittest.TestCase):
|
class HtpasswdAuthTestCase(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue