Skip to content

Unit tests for the scheduler daily-limit reset #8

Description

@alimaandev

Problem

shortube/scheduler.py resets _generated_today when _last_date differs from today (_reset_daily_count), but this behaviour is not directly unit-tested. A regression here would silently let the daily cap be bypassed.

Task

Add tests covering:

  • Counter resets when the date changes
  • Counter is not reset when the date is the same
  • Persisted counter is restored on reload (_load_config)
  • The cap stops new uploads once reached (_run_scheduled_job with a mocked discover)

Acceptance criteria

  • New tests in tests/test_scheduler.py pass
  • Existing scheduler tests still pass
  • No network/LLM calls (mock discover and run_pipeline)

Files

  • tests/test_scheduler.py
  • shortube/scheduler.py (read-only reference)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions