Simplify archiving process (#469)

* simplify args

* Fix tests

* Black format
This commit is contained in:
Anton Osika
2023-07-02 16:43:13 +02:00
committed by GitHub
parent 60e0a7e1dd
commit 20ea0c126a
6 changed files with 40 additions and 45 deletions

View File

@@ -3,8 +3,7 @@ import os
from unittest.mock import MagicMock
from gpt_engineer.db import DB, DBs
from gpt_engineer.steps import archive
from gpt_engineer.db import DB, DBs, archive
def freeze_at(monkeypatch, time):
@@ -28,7 +27,7 @@ def test_archive(tmp_path, monkeypatch):
tmp_path, ["memory", "logs", "preprompts", "input", "workspace", "archive"]
)
freeze_at(monkeypatch, datetime.datetime(2020, 12, 25, 17, 5, 55))
archive(None, dbs)
archive(dbs)
assert not os.path.exists(tmp_path / "memory")
assert not os.path.exists(tmp_path / "workspace")
assert os.path.isdir(tmp_path / "archive" / "20201225_170555")
@@ -37,7 +36,7 @@ def test_archive(tmp_path, monkeypatch):
tmp_path, ["memory", "logs", "preprompts", "input", "workspace", "archive"]
)
freeze_at(monkeypatch, datetime.datetime(2022, 8, 14, 8, 5, 12))
archive(None, dbs)
archive(dbs)
assert not os.path.exists(tmp_path / "memory")
assert not os.path.exists(tmp_path / "workspace")
assert os.path.isdir(tmp_path / "archive" / "20201225_170555")