* backend: max pages per crawl limit, part of fix for #716: - set 'max_pages_crawl_limit' in values.yaml, default to 100,000 - if set/non-0, automatically set limit if none provided - if set/non-0, return 400 if adding config with limit exceeding max limit - return limit as 'maxPagesPerCrawl' in /api/settings - api: /all/crawls - add runningOnly=0 to show all crawls, default to 1/true (for more reliable testing) tests: add test for 'max_pages_per_crawl' setting - ensure 'limit' can not be set higher than max_pages_per_crawl - ensure pages crawled is at the limit - set test limit to max 2 pages - add settings test - check for pages.jsonl and extraPages.jsonl when crawling 2 pages
18 lines
348 B
Python
18 lines
348 B
Python
import requests
|
|
|
|
from .conftest import API_PREFIX
|
|
|
|
|
|
def test_settings():
|
|
r = requests.get(f"{API_PREFIX}/settings")
|
|
assert r.status_code == 200
|
|
|
|
data = r.json()
|
|
|
|
assert data == {
|
|
"registrationEnabled": False,
|
|
"jwtTokenLifetime": 86400,
|
|
"defaultBehaviorTimeSeconds": 300,
|
|
"maxPagesPerCrawl": 2,
|
|
}
|