コード例 #1
0
def test_check_credentials_with_wrong_cafile(opt_adcs):
    dir_path = os.path.dirname(os.path.realpath(__file__))
    ca_bundle = '%s/test_dummy-ca-cert.pem' % dir_path
    with pytest.raises(SSLError) as excinfo:
        certsrv.check_credentials(opt_adcs,
                                  'username',
                                  'password',
                                  cafile=ca_bundle)
コード例 #2
0
ファイル: test_certsrv.py プロジェクト: ylfingr/certsrv
def test_check_wrong_credentials(opt_adcs):
    assert certsrv.check_credentials(opt_adcs, 'wronguser', 'wrongpassword') == False
コード例 #3
0
ファイル: test_certsrv.py プロジェクト: ylfingr/certsrv
def test_check_credentials(opt_adcs, opt_username, opt_password):
    assert certsrv.check_credentials(opt_adcs, opt_username, opt_password)
コード例 #4
0
ファイル: test_certsrv.py プロジェクト: ylfingr/certsrv
def test_check_credentials_with_wrong_cafile(opt_adcs):
    dir_path = os.path.dirname(os.path.realpath(__file__))
    ca_bundle = '%s/test_dummy-ca-cert.pem' % dir_path
    with pytest.raises(URLError) as excinfo:
        certsrv.check_credentials(opt_adcs, 'username', 'password', cafile=ca_bundle)
    assert excinfo.value.reason.reason == 'CERTIFICATE_VERIFY_FAILED'
コード例 #5
0
ファイル: test_certsrv.py プロジェクト: ylfingr/certsrv
def test_check_wrong_credentials_with_ntlm(opt_adcs):
    assert certsrv.check_credentials(opt_adcs, 'wronguser', 'wrongpassword', auth_method='ntlm') == False
コード例 #6
0
ファイル: test_certsrv.py プロジェクト: ylfingr/certsrv
def test_check_credentials_with_ntlm(opt_adcs, opt_username, opt_password):
    assert certsrv.check_credentials(opt_adcs, opt_username, opt_password, auth_method='ntlm')