コード例 #1
0
ファイル: test_config.py プロジェクト: jeffmaxey/faculty
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
ファイル: test_config.py プロジェクト: jeffmaxey/faculty
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
ファイル: test_config.py プロジェクト: jeffmaxey/faculty
def test_resolve_credentials_path_override(mocker):
    assert config.resolve_credentials_path("override/path") == "override/path"
コード例 #4
0
ファイル: test_config.py プロジェクト: jeffmaxey/faculty
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
ファイル: test_config.py プロジェクト: jeffmaxey/faculty
def test_resolve_credentials_path(mocker):
    mocker.patch("faculty.config._default_credentials_path")
    assert (
        config.resolve_credentials_path()
        == config._default_credentials_path.return_value
    )