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
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
def test_resolve_credentials_path_override(mocker): assert config.resolve_credentials_path("override/path") == "override/path"
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
def test_resolve_credentials_path(mocker): mocker.patch("faculty.config._default_credentials_path") assert ( config.resolve_credentials_path() == config._default_credentials_path.return_value )