Refactor code style and improve documentation
- 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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user