Default IS write_back=True so refresh-token rotation propagates to disk for other processes (Rust CLI, TUI, second Python client).
(tmp_path: Path)
| 839 | |
| 840 | |
| 841 | def test_refresher_write_back_is_default(tmp_path: Path) -> None: |
| 842 | """Default IS write_back=True so refresh-token rotation propagates to |
| 843 | disk for other processes (Rust CLI, TUI, second Python client).""" |
| 844 | _write_bundle(tmp_path, access_token="old", expires_at=1) |
| 845 | transport = _make_mock_transport( |
| 846 | refresh_responses=[ |
| 847 | { |
| 848 | "access_token": "rotated", |
| 849 | "refresh_token": "r-new", |
| 850 | "expires_in": 3600, |
| 851 | } |
| 852 | ], |
| 853 | ) |
| 854 | r = _OidcRefresher(tmp_path, "g") # default write_back=True |
| 855 | _install_mock_transport(r, transport) |
| 856 | |
| 857 | r.current_access_token() |
| 858 | on_disk = json.loads((tmp_path / "oidc_token.json").read_text()) |
| 859 | assert on_disk["access_token"] == "rotated" |
| 860 | assert on_disk["refresh_token"] == "r-new" |
| 861 | |
| 862 | |
| 863 | def test_refresher_honors_refresh_token_rotation(tmp_path: Path) -> None: |
nothing calls this directly
no test coverage detected