test_cli_shell.py 642 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env python3
  2. """
  3. Tests for archivebox shell command.
  4. Verify shell command starts Django shell (basic smoke tests only).
  5. """
  6. import os
  7. import subprocess
  8. from .fixtures import *
  9. def test_shell_command_exists(tmp_path, process):
  10. """Test that shell command is recognized."""
  11. os.chdir(tmp_path)
  12. # Test that the command exists (will fail without input but should recognize command)
  13. result = subprocess.run(
  14. ['archivebox', 'shell', '--help'],
  15. capture_output=True,
  16. text=True,
  17. timeout=10,
  18. )
  19. # Should show shell help or recognize command
  20. assert result.returncode in [0, 1, 2]