From 6d6108436f9af9ed0a26e00a95ac44416d37db11 Mon Sep 17 00:00:00 2001 From: jackwener Date: Wed, 11 Mar 2026 12:57:34 +0800 Subject: [PATCH] chore: bump version to 0.6.0 Changes since 0.5.1: - feat: Chrome multi-profile cookie extraction (#6) - fix: warn on private likes (#8) - fix: add logger definition (CI fix) - refactor: specific ImportError handling (#10) - docs: upgrade instructions in README and SKILL.md --- pyproject.toml | 2 +- tests/test_auth.py | 27 +++++++++++---------------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ea397f9..66360a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "twitter-cli" -version = "0.5.1" +version = "0.6.0" description = "A CLI for Twitter/X — feed, bookmarks, and user timeline in terminal" readme = "README.md" license = "Apache-2.0" diff --git a/tests/test_auth.py b/tests/test_auth.py index 4726140..f2b84bd 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -192,7 +192,14 @@ def test_verify_cookies_logs_attempt_summary_on_non_auth_failures(monkeypatch, c def test_iter_chrome_cookie_files_default_first(monkeypatch, tmp_path) -> None: """Default profile should be yielded first, then Profile N sorted.""" - chrome_dir = tmp_path / "Google" / "Chrome" + # Create the correct platform-specific directory structure + if sys.platform == "darwin": + chrome_dir = tmp_path / "Library" / "Application Support" / "Google" / "Chrome" + elif sys.platform == "win32": + chrome_dir = tmp_path / "Google" / "Chrome" / "User Data" + else: + chrome_dir = tmp_path / ".config" / "Google" / "Chrome" + (chrome_dir / "Default").mkdir(parents=True) (chrome_dir / "Default" / "Cookies").touch() (chrome_dir / "Profile 2").mkdir() @@ -201,21 +208,9 @@ def test_iter_chrome_cookie_files_default_first(monkeypatch, tmp_path) -> None: (chrome_dir / "Profile 1" / "Cookies").touch() monkeypatch.delenv("TWITTER_CHROME_PROFILE", raising=False) - - # Patch the platform root to use tmp_path - if sys.platform == "darwin": - monkeypatch.setenv("HOME", str(tmp_path)) - monkeypatch.setattr(auth, "_CHROMIUM_BASE_DIRS", {"chrome": os.path.join("Google", "Chrome")}) - # On macOS, root = ~/Library/Application Support/ - # We need to adjust: create the macOS path structure - mac_chrome = tmp_path / "Library" / "Application Support" / "Google" / "Chrome" - mac_chrome.mkdir(parents=True, exist_ok=True) - (mac_chrome / "Default").mkdir(exist_ok=True) - (mac_chrome / "Default" / "Cookies").touch() - (mac_chrome / "Profile 1").mkdir(exist_ok=True) - (mac_chrome / "Profile 1" / "Cookies").touch() - (mac_chrome / "Profile 2").mkdir(exist_ok=True) - (mac_chrome / "Profile 2" / "Cookies").touch() + monkeypatch.setenv("HOME", str(tmp_path)) + if sys.platform == "win32": + monkeypatch.setenv("LOCALAPPDATA", str(tmp_path)) paths = auth._iter_chrome_cookie_files("chrome")