Make cookie-file auth env-only for multi-account use
This commit is contained in:
@@ -103,6 +103,7 @@ def test_load_from_cookie_file_parses_netscape_cookie_dump(tmp_path) -> None:
|
||||
|
||||
def test_get_cookies_uses_cookie_file_before_browser(monkeypatch) -> None:
|
||||
monkeypatch.setattr(auth, "load_from_env", lambda: None)
|
||||
monkeypatch.setenv("TWITTER_COOKIE_FILE", "/tmp/cookies.txt")
|
||||
monkeypatch.setattr(
|
||||
auth,
|
||||
"load_from_cookie_file",
|
||||
@@ -116,7 +117,7 @@ def test_get_cookies_uses_cookie_file_before_browser(monkeypatch) -> None:
|
||||
lambda auth_token, ct0, cookie_string=None: seen.append((auth_token, ct0, cookie_string)) or {},
|
||||
)
|
||||
|
||||
cookies = auth.get_cookies({"auth": {"cookieFile": "/tmp/cookies.txt"}})
|
||||
cookies = auth.get_cookies()
|
||||
|
||||
assert cookies["auth_token"] == "file-token"
|
||||
assert seen == [("file-token", "file-csrf", "a=1")]
|
||||
|
||||
Reference in New Issue
Block a user