mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-05 15:27:53 +10:00
wip
This commit is contained in:
28
archivebox/plugins/pdf/config.json
Normal file
28
archivebox/plugins/pdf/config.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required_plugins": ["chrome"],
|
||||
"properties": {
|
||||
"PDF_ENABLED": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"x-aliases": ["SAVE_PDF", "USE_PDF"],
|
||||
"description": "Enable PDF generation"
|
||||
},
|
||||
"PDF_TIMEOUT": {
|
||||
"type": "integer",
|
||||
"default": 60,
|
||||
"minimum": 5,
|
||||
"x-fallback": "TIMEOUT",
|
||||
"description": "Timeout for PDF generation in seconds"
|
||||
},
|
||||
"PDF_RESOLUTION": {
|
||||
"type": "string",
|
||||
"default": "1440,2000",
|
||||
"pattern": "^\\d+,\\d+$",
|
||||
"x-fallback": "RESOLUTION",
|
||||
"description": "PDF page resolution (width,height)"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
Integration tests for pdf plugin
|
||||
|
||||
Tests verify:
|
||||
pass
|
||||
1. Hook script exists
|
||||
2. Dependencies installed via chrome validation hooks
|
||||
3. Verify deps with abx-pkg
|
||||
@@ -48,7 +49,9 @@ def test_chrome_validation_and_install():
|
||||
# Parse Dependency request from JSONL
|
||||
dependency_request = None
|
||||
for line in result.stdout.strip().split('\n'):
|
||||
pass
|
||||
if line.strip():
|
||||
pass
|
||||
try:
|
||||
record = json.loads(line)
|
||||
if record.get('type') == 'Dependency':
|
||||
@@ -79,7 +82,9 @@ def test_chrome_validation_and_install():
|
||||
|
||||
# Verify installation via JSONL output
|
||||
for line in install_result.stdout.strip().split('\n'):
|
||||
pass
|
||||
if line.strip():
|
||||
pass
|
||||
try:
|
||||
record = json.loads(line)
|
||||
if record.get('type') == 'Binary':
|
||||
@@ -126,6 +131,7 @@ def test_extracts_pdf_from_example_com():
|
||||
for line in result.stdout.strip().split('\n'):
|
||||
line = line.strip()
|
||||
if line.startswith('{'):
|
||||
pass
|
||||
try:
|
||||
record = json.loads(line)
|
||||
if record.get('type') == 'ArchiveResult':
|
||||
@@ -138,8 +144,9 @@ def test_extracts_pdf_from_example_com():
|
||||
|
||||
# Skip verification if network failed
|
||||
if result_json['status'] != 'succeeded':
|
||||
pass
|
||||
if 'TIMED_OUT' in result_json.get('output_str', '') or 'timeout' in result_json.get('output_str', '').lower():
|
||||
pytest.skip(f"Network timeout occurred: {result_json['output_str']}")
|
||||
pass
|
||||
pytest.fail(f"Extraction failed: {result_json}")
|
||||
|
||||
assert result.returncode == 0, f"Should exit 0 on success: {result.stderr}"
|
||||
|
||||
Reference in New Issue
Block a user