Пример #1
0
def test_resolve_credentials_path_env_sherlockml(mocker):
    path = "override/path"
    mocker.patch.dict(os.environ, {"SHERLOCKML_CREDENTIALS_PATH": path})
    with pytest.warns(
        UserWarning, match="SHERLOCKML_CREDENTIALS_PATH is deprecated"
    ):
        assert config.resolve_credentials_path() == path
Пример #2
0
def test_resolve_credentials_path_env_faculty_precedence(mocker):
    path = "override/path"
    mocker.patch.dict(
        os.environ,
        {
            "FACULTY_CREDENTIALS_PATH": path,
            "SHERLOCKML_CREDENTIALS_PATH": "ignored",
        },
    )
    assert config.resolve_credentials_path() == path
Пример #3
0
def test_resolve_credentials_path_override(mocker):
    assert config.resolve_credentials_path("override/path") == "override/path"
Пример #4
0
def test_resolve_credentials_path_env(mocker):
    path = "override/path"
    mocker.patch.dict(os.environ, {"FACULTY_CREDENTIALS_PATH": path})
    assert config.resolve_credentials_path() == path
Пример #5
0
def test_resolve_credentials_path(mocker):
    mocker.patch("faculty.config._default_credentials_path")
    assert (
        config.resolve_credentials_path()
        == config._default_credentials_path.return_value
    )