1 Star 0 Fork 0

内网之家/ArchiveBox

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_update.py 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
Nick Sweeting 提交于 2021-04-04 03:50 +08:00 . fix select invalid test
import sqlite3
from .fixtures import *
def test_update_status_invalid(tmp_path, process, disable_extractors_dict):
subprocess.run(['archivebox', 'add', 'http://127.0.0.1:8080/static/example.com.html'], capture_output=True, env=disable_extractors_dict)
assert list((tmp_path / "archive").iterdir()) != []
a_process = subprocess.run(['archivebox', 'remove', 'http://127.0.0.1:8080/static/example.com.html', '--yes'], capture_output=True)
conn = sqlite3.connect(str(tmp_path / "index.sqlite3"))
c = conn.cursor()
link = c.execute("SELECT * FROM core_snapshot").fetchone()
conn.commit()
conn.close()
assert link is None
update_process = subprocess.run(['archivebox', 'update', '--status=invalid'], capture_output=True, env=disable_extractors_dict)
conn = sqlite3.connect(str(tmp_path / "index.sqlite3"))
c = conn.cursor()
url = c.execute("SELECT url FROM core_snapshot").fetchone()[0]
conn.commit()
conn.close()
assert url == 'http://127.0.0.1:8080/static/example.com.html'
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/localnetwork/ArchiveBox.git
git@gitee.com:localnetwork/ArchiveBox.git
localnetwork
ArchiveBox
ArchiveBox
master

搜索帮助