Commit Graph

6 Commits

Author SHA1 Message Date
aserper
9439b6c8fb feat: add support for multiple RSS feeds 2025-12-13 00:27:36 -05:00
aserper
15409ff4e1 Refactor integration tests to use feedparser mocking
Replace responses library HTTP mocking with direct feedparser.parse()
mocking to eliminate XML parsing compatibility issues. All integration
tests now mock feedparser output directly, avoiding HTTP layer complexity.

Changes:
- Replace responses.activate decorators with feedparser.parse patches
- Mock feed objects directly instead of mocking HTTP responses
- Remove responses library dependency from requirements-test.txt
- Simplify test setup by eliminating XML string encoding issues

This approach provides more reliable testing by directly controlling
feedparser behavior rather than relying on HTTP mocking layer.
2025-12-12 23:43:07 -05:00
aserper
9fb4a25cbb Fix responses library XML encoding issues
- Encode XML strings as UTF-8 bytes for responses library
- Add charset to content-type headers
- This should fix feedparser XML parsing errors
2025-12-12 23:38:59 -05:00
aserper
e329252465 Fix XML indentation in integration tests
- Remove dedent() and use raw XML strings starting at column 0
- This fixes the XML parsing errors in all integration tests
- Remove unused textwrap import
2025-12-12 23:36:38 -05:00
aserper
abfdeb4b9c Fix test failures and code quality issues
- Fix XML parsing in integration tests using textwrap.dedent
- Fix Docker build test by adding load:true to buildx action
- Apply black formatting to all Python files
- All tests should now pass successfully
2025-12-12 23:34:10 -05:00
aserper
f2056b90f2 Add comprehensive test suite with GitHub Actions CI/CD
- Refactor code into testable bot.py module with MastodonRSSBot class
- Create 20+ unit tests covering core functionality and edge cases
- Create 10+ integration tests for RSS parsing and Mastodon posting
- Add GitHub Actions workflow for automated testing
  - Unit tests on Python 3.10, 3.11, 3.12
  - Integration tests with mocked external services
  - Code quality checks (flake8, black, mypy)
  - Docker build validation
- Configure pytest with 80% minimum coverage requirement
- Add test dependencies in requirements-test.txt
- Update .gitignore to exclude test artifacts
- Add comprehensive TESTING.md documentation
- Add test status badge to README
- Maintain full backward compatibility with existing setup
2025-12-12 23:30:38 -05:00