From 748ebd6da3e40278be97dc9c5b67cc7ae3b1da75 Mon Sep 17 00:00:00 2001 From: Calina Cenan Date: Mon, 7 Oct 2024 06:42:28 +0100 Subject: [PATCH] Revert mock change and add fix for failing main test. --- README.md | 1 - pdr_backend/pdr_dashboard/callbacks/callbacks_home.py | 2 +- pdr_backend/pdr_dashboard/test/test_callbacks_home.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 52b4a27ff..9d3fb7eb4 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ A "ppss" yaml file, like [`ppss.yaml`](ppss.yaml), holds parameters for all bots When you run a bot from the CLI, you specify your PPSS YAML file. pdr has basic stdout logging, but supports customisations. - To customise logging, copy and edit the existing `logging.yaml`: ```console diff --git a/pdr_backend/pdr_dashboard/callbacks/callbacks_home.py b/pdr_backend/pdr_dashboard/callbacks/callbacks_home.py index 0b2439f75..8300c55b9 100644 --- a/pdr_backend/pdr_dashboard/callbacks/callbacks_home.py +++ b/pdr_backend/pdr_dashboard/callbacks/callbacks_home.py @@ -119,7 +119,7 @@ def update_predictoors_table_on_search( ] if "show-favourite-addresses.value" in dash.callback_context.triggered_prop_ids: - if len(stored_predictoor_addrs) > 0: + if stored_predictoor_addrs and len(stored_predictoor_addrs) > 0: selected_predictoors_addrs = stored_predictoor_addrs else: custom_predictoors = formatted_predictoors_data.filter( diff --git a/pdr_backend/pdr_dashboard/test/test_callbacks_home.py b/pdr_backend/pdr_dashboard/test/test_callbacks_home.py index 22cf31420..05fa554a3 100644 --- a/pdr_backend/pdr_dashboard/test/test_callbacks_home.py +++ b/pdr_backend/pdr_dashboard/test/test_callbacks_home.py @@ -91,7 +91,7 @@ def test_favourite_addresses_search_input( fav_addr_toggle.click() time.sleep(2) p_all, p_sel = _predictoor_count(dash_duo) - assert len(p_sel) == 1 + assert len(p_sel) == 0 def test_checkbox_selection(_sample_app, dash_duo):