mirror of
https://github.com/aserper/masto-rss.git
synced 2025-12-17 05:15:25 +00:00
- 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
26 lines
822 B
Python
26 lines
822 B
Python
"""Mastodon RSS Bot - Entry point"""
|
|
import os
|
|
from bot import MastodonRSSBot
|
|
|
|
|
|
def main():
|
|
"""Initialize and run the bot with environment configuration"""
|
|
# Load configuration from environment variables
|
|
bot = MastodonRSSBot(
|
|
client_id=os.environ['MASTODON_CLIENT_ID'],
|
|
client_secret=os.environ['MASTODON_CLIENT_SECRET'],
|
|
access_token=os.environ['MASTODON_ACCESS_TOKEN'],
|
|
instance_url=os.environ['MASTODON_INSTANCE_URL'],
|
|
feed_url=os.environ['RSS_FEED_URL'],
|
|
toot_visibility=os.environ.get('TOOT_VISIBILITY', 'public'),
|
|
check_interval=int(os.environ.get('CHECK_INTERVAL', '300')),
|
|
state_file=os.environ.get('PROCESSED_ENTRIES_FILE', '/state/processed_entries.txt')
|
|
)
|
|
|
|
# Start the bot
|
|
bot.run()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|