3 Commits

Author SHA1 Message Date
Type-Delta
6813dc9b4c test: Add comprehensive test coverage across modules
Adds extensive test suite covering CLI notifications, auth service,
file utilities, networking, AniList API integration, mappers, API
factory, MPV player, and selector implementations. Includes 900+ lines
of test code covering main workflows and edge cases. Minor refactor
to improve dict type safety in AniList API client.

- CLI and service layer tests
- Utility function tests
- Media API and mapper tests
- Player and selector factory tests
2026-04-06 09:01:45 +07:00
Albert Medrano-Lopez
efa6f4d142 fix(tests): Resolve pyright type errors in anilist test_mapper.py
Updated mock data in `test_to_generic_user_profile_success` to conform to `AnilistViewerData` requirements.
Adjusted type annotations in tests with intentionally malformed data to `Any` to prevent pyright errors, ensuring proper validation of error handling.
2025-12-29 23:25:40 -08:00
Albert Medrano-Lopez
b62d878a0e feat(auth): Allow non-interactive Anilist authentication
This enhances the `anilist auth` command by allowing the authentication token to be provided directly as an argument or from a file. This provides a non-interactive way to authenticate, which is useful for scripting or for users who have issues with the interactive browser-based flow.

The `auth` command now accepts an optional `token_input` argument.
- If the argument is a valid file path, the token is read from the file.
- Otherwise, the argument is treated as the token itself.
- If no argument is provided, the command falls back to the previous interactive method.

The README is also updated to document these new authentication options.

This commit also includes:
- `test`: Unit tests for the new authentication logic (``test_auth.py``) and for the mapper fix (``test_mapper.py``).
- `fix(api)`: A fix in the Anilist API mapper to handle potentially missing data in the API response, making it more robust.
- `style`: Minor code style and formatting fixes throughout the codebase.
2025-12-29 04:05:28 -08:00