test_cli_help.py 900 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python3
  2. """
  3. Tests for archivebox help command.
  4. Verify command runs successfully and produces output.
  5. """
  6. import os
  7. import subprocess
  8. from .fixtures import *
  9. def test_help_runs_successfully(tmp_path):
  10. """Test that help command runs and produces output."""
  11. os.chdir(tmp_path)
  12. result = subprocess.run(['archivebox', 'help'], capture_output=True, text=True)
  13. assert result.returncode == 0
  14. combined = result.stdout + result.stderr
  15. assert len(combined) > 100
  16. assert 'archivebox' in combined.lower()
  17. def test_help_in_initialized_dir(tmp_path, process):
  18. """Test help command in initialized data directory."""
  19. os.chdir(tmp_path)
  20. result = subprocess.run(['archivebox', 'help'], capture_output=True, text=True)
  21. assert result.returncode == 0
  22. combined = result.stdout + result.stderr
  23. assert 'init' in combined
  24. assert 'add' in combined