From 242b2a0b59f0e19ee1dca187051703d811089df2 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 20 May 2024 16:22:37 +1000 Subject: [PATCH] tests: clean up tests after events changes --- .../app/services/download/test_download_queue.py | 15 --------------- .../services/model_install/test_model_install.py | 8 -------- 2 files changed, 23 deletions(-) diff --git a/tests/app/services/download/test_download_queue.py b/tests/app/services/download/test_download_queue.py index 98fed861ae..72c78da814 100644 --- a/tests/app/services/download/test_download_queue.py +++ b/tests/app/services/download/test_download_queue.py @@ -131,14 +131,6 @@ def test_event_bus(tmp_path: Path, session: Session) -> None: assert events[1].total_bytes > 0 assert events[1].current_bytes <= events[1].total_bytes assert events[2].total_bytes == 32029 - # assert events[0].payload["timestamp"] <= events[1].payload["timestamp"] - # assert events[1].payload["timestamp"] <= events[2].payload["timestamp"] - # assert events[0].event_name == "download_started" - # assert events[1].event_name == "download_progress" - # assert events[1].payload["total_bytes"] > 0 - # assert events[1].payload["current_bytes"] <= events[1].payload["total_bytes"] - # assert events[2].event_name == "download_complete" - # assert events[2].payload["total_bytes"] == 32029 # test a failure event_bus.events = [] # reset our accumulator @@ -151,11 +143,6 @@ def test_event_bus(tmp_path: Path, session: Session) -> None: assert events[0].error_type == "HTTPError(NOT FOUND)" assert events[0].error is not None assert re.search(r"requests.exceptions.HTTPError: NOT FOUND", events[0].error) - - # assert events[0].event_name == "download_error" - # assert events[0].payload["error_type"] == "HTTPError(NOT FOUND)" - # assert events[0].payload["error"] is not None - # assert re.search(r"requests.exceptions.HTTPError: NOT FOUND", events[0].payload["error"]) queue.stop() @@ -224,6 +211,4 @@ def test_cancel(tmp_path: Path, session: Session) -> None: events = event_bus.events assert isinstance(events[-1], DownloadCancelledEvent) assert events[-1].source == "http://www.civitai.com/models/12345" - # assert events[-1].event_name == "download_cancelled" - # assert events[-1].payload["source"] == "http://www.civitai.com/models/12345" queue.stop() diff --git a/tests/app/services/model_install/test_model_install.py b/tests/app/services/model_install/test_model_install.py index 596a372d4c..b380414be8 100644 --- a/tests/app/services/model_install/test_model_install.py +++ b/tests/app/services/model_install/test_model_install.py @@ -150,14 +150,6 @@ def test_background_install( key = bus.events[1].key assert key is not None - # event_names = [x.event_name for x in bus.events] - # assert "model_install_running" in event_names - # assert "model_install_completed" in event_names - # assert Path(bus.events[0].payload["source"]) == source - # assert Path(bus.events[1].payload["source"]) == source - # key = bus.events[1].payload["key"] - # assert key is not None - # see if the thing actually got installed at the expected location model_record = mm2_installer.record_store.get_model(key) assert model_record is not None