Keep live API tests within the server boundary

This commit is contained in:
Nick Sweeting 2026-07-29 17:12:55 -07:00
parent e86937f9cd
commit 8099a47807
No known key found for this signature in database
3 changed files with 16 additions and 15 deletions

View File

@ -1,8 +1,8 @@
import pytest
from archivebox.core.models import Snapshot
from archivebox.crawls.models import Crawl
from archivebox.tests.test_orm_helpers import use_archivebox_db
from .conftest import (
cli_env,
create_admin_and_token,
@ -109,18 +109,18 @@ def test_cli_api_add_search_update_remove_over_server(tmp_path):
)
assert update_response.status_code == 200, update_response.text
assert update_response.json()["success"] is True
stop_server(tmp_path)
start_archivebox_server(tmp_path, env=env, port=port)
wait_for_live_api(port)
with use_archivebox_db(tmp_path):
crawl_obj = Crawl.objects.filter(pk=crawl_id).first()
crawl = (crawl_obj.max_depth, crawl_obj.tags_str, crawl_obj.config) if crawl_obj else None
assert crawl is not None
assert crawl[0] == 0
assert crawl[1] == "api-cli"
assert crawl[2]["INDEX_ONLY"] is True
crawl_response = live_api_request(
port,
"get",
f"/api/v1/crawls/crawl/{crawl_id}",
api_token=api_token,
)
assert crawl_response.status_code == 200, crawl_response.text
crawl = crawl_response.json()
assert crawl["max_depth"] == 0
assert crawl["tags_str"] == "api-cli"
assert crawl["config"]["INDEX_ONLY"] is True
remove_response = live_api_request(
port,
@ -142,6 +142,7 @@ def test_cli_api_add_search_update_remove_over_server(tmp_path):
assert remove_payload["result"]["removed_count"] == 1
assert snapshot_id in remove_payload["result"]["removed_snapshot_ids"]
stop_server(tmp_path)
with use_archivebox_db(tmp_path):
snapshot_count = Snapshot.objects.filter(pk=snapshot_id).count()

View File

@ -1,6 +1,6 @@
{
"name": "archivebox",
"version": "0.9.35rc180",
"version": "0.9.35rc181",
"repository": "github:ArchiveBox/ArchiveBox",
"license": "MIT",
"dependencies": {

View File

@ -1,6 +1,6 @@
[project]
name = "archivebox"
version = "0.9.35rc180"
version = "0.9.35rc181"
requires-python = ">=3.13"
description = "Self-hosted internet archiving solution."
authors = [{name = "Nick Sweeting", email = "pyproject.toml@archivebox.io"}]
@ -344,7 +344,7 @@ Donate = "https://github.com/ArchiveBox/ArchiveBox/wiki/Donations"
[tool.bumpver]
current_version = "v0.9.35rc180"
current_version = "v0.9.35rc181"
version_pattern = "vMAJOR.MINOR.PATCH[PYTAGNUM]"
commit_message = "bump version {old_version} -> {new_version}"
tag_message = "{new_version}"