Refactor code style and improve documentation
CI / Quality Checks (push) Failing after 12s
CI / Test Suite (push) Successful in 10s

- Standardized string quotes to single quotes across all files.
- Added docstrings to several functions and classes for better clarity.
- Updated mypy configuration in pyproject.toml for enhanced type checking.
- Ignored specific linting rules for test files in ruff configuration.
- Improved error messages in exception handling for better user feedback.
- Cleaned up code formatting and structure for consistency.
This commit is contained in:
ВяткинАртём
2026-05-27 17:24:30 +03:00
parent 1c3228e039
commit d7cbd876ea
23 changed files with 214 additions and 203 deletions
+9 -9
View File
@@ -6,17 +6,17 @@ from yt_shorts_downloader.session import validate_session_file
def test_validate_session_file_accepts_valid_youtube_session(tmp_path: Path) -> None:
session_file = tmp_path / "cookies.txt"
session_file = tmp_path / 'cookies.txt'
session_file.write_text(
"\n".join(
'\n'.join(
[
"# Netscape HTTP Cookie File",
".youtube.com\tTRUE\t/\tFALSE\t9999999999\tSID\tvalue1",
".youtube.com\tTRUE\t/\tTRUE\t9999999999\tSAPISID\tvalue2",
".youtube.com\tTRUE\t/\tTRUE\t9999999999\tLOGIN_INFO\tvalue3",
'# Netscape HTTP Cookie File',
'.youtube.com\tTRUE\t/\tFALSE\t9999999999\tSID\tvalue1',
'.youtube.com\tTRUE\t/\tTRUE\t9999999999\tSAPISID\tvalue2',
'.youtube.com\tTRUE\t/\tTRUE\t9999999999\tLOGIN_INFO\tvalue3',
]
),
encoding="utf-8",
encoding='utf-8',
)
validation = validate_session_file(session_file)
@@ -28,8 +28,8 @@ def test_validate_session_file_accepts_valid_youtube_session(tmp_path: Path) ->
def test_validate_session_file_rejects_invalid_format(tmp_path: Path) -> None:
session_file = tmp_path / "cookies.txt"
session_file.write_text("broken\trow", encoding="utf-8")
session_file = tmp_path / 'cookies.txt'
session_file.write_text('broken\trow', encoding='utf-8')
validation = validate_session_file(session_file)