test(chatgpt): keep authenticator tests out of the real token directory

This commit is contained in:
mateo-berri 2026-09-03 11:57:04 -07:00
parent 29baf5a6bd
commit 94f34b7032

View file

@ -25,9 +25,9 @@ def _make_jwt(payload: dict) -> str:
class TestChatGPTAuthenticator:
@pytest.fixture
def authenticator(self):
with patch("os.path.exists", return_value=True):
return Authenticator()
def authenticator(self, tmp_path, monkeypatch):
monkeypatch.setenv("CHATGPT_TOKEN_DIR", str(tmp_path))
return Authenticator()
def test_get_access_token_from_file(self, authenticator):
future_time = time.time() + 3600