forked from github.com/pypiserver
#55: Do not require passlib
when -P == '.'.
This commit is contained in:
parent
1bd5b3973c
commit
000e977978
@ -116,7 +116,7 @@ def configure(root=None,
|
||||
config.redirect_to_fallback = redirect_to_fallback
|
||||
config.fallback_url = fallback_url
|
||||
config.cache_control = cache_control
|
||||
if password_file:
|
||||
if password_file and password_file != '.':
|
||||
from passlib.apache import HtpasswdFile # @UnresolvedImport
|
||||
config.htpasswdfile = HtpasswdFile(password_file)
|
||||
config.overwrite = overwrite
|
||||
|
@ -130,7 +130,5 @@ def test_password_alone(main, monkeypatch):
|
||||
assert main.app.module.config.authenticated == ['update']
|
||||
|
||||
def test_dot_password_without_auth_list(main, monkeypatch):
|
||||
monkeypatch.setitem(sys.modules, 'passlib', mock.MagicMock())
|
||||
monkeypatch.setitem(sys.modules, 'passlib.apache', mock.MagicMock())
|
||||
main(["-P", ".", "-a", ""])
|
||||
assert main.app.module.config.authenticated == []
|
||||
|
Loading…
Reference in New Issue
Block a user