Beispiel #1
0
def test_keyring_raises_errors_on_keyring_errors(mocker, with_fail_keyring):
    mocker.patch("poetry.utils.password_manager.KeyRing._check")

    key_ring = KeyRing("poetry")
    with pytest.raises(KeyRingError):
        key_ring.set_password("foo", "bar", "baz")

    with pytest.raises(KeyRingError):
        key_ring.get_password("foo", "bar")

    with pytest.raises(KeyRingError):
        key_ring.delete_password("foo", "bar")
Beispiel #2
0
def test_keyring_with_chainer_backend_and_not_compatible_only_should_be_unavailable(
    mock_chainer_backend, ):
    key_ring = KeyRing("poetry")

    assert not key_ring.is_available()
Beispiel #3
0
def test_fail_keyring_should_be_unavailable(with_fail_keyring: None, ):
    key_ring = KeyRing("poetry")

    assert not key_ring.is_available()
Beispiel #4
0
def test_keyring_with_chainer_backend_and_null_keyring_should_be_unavailable(
    with_chained_null_keyring: None, ):
    key_ring = KeyRing("poetry")

    assert not key_ring.is_available()