def test_guess_gpg_home_exception(base_context, mocker):
    env = {}
    base_context.config['gpg_home'] = None
    mocker.patch.object(os, "environ", new=env)
    with pytest.raises(ScriptWorkerGPGException):
        sgpg.guess_gpg_home(base_context)
def test_guess_gpg_home(base_context, gpg_home, expected):
    assert sgpg.guess_gpg_home(base_context, gpg_home=gpg_home) == expected
def test_guess_gpg_home_GPG(base_context, gpg_home, expected, tmpdir):
    expected = expected or tmpdir
    gpg = sgpg.GPG(base_context, tmpdir)
    assert sgpg.guess_gpg_home(gpg, gpg_home) == expected
Exemple #4
0
def test_guess_gpg_home_GPG(base_context, gpg_home, expected):
    gpg = sgpg.GPG(base_context, "bar")
    assert sgpg.guess_gpg_home(gpg, gpg_home) == expected