From 1e97000eb128c75900a24c8930d9c16c2ef16d58 Mon Sep 17 00:00:00 2001 From: SeanScripts Date: Thu, 9 Feb 2023 22:07:35 +0000 Subject: [PATCH] Simplify convert_page for v1.6 and remove unused functions in agent_checker_util --- src/dfcx_scrapi/core/test_cases.py | 12 ++------ src/dfcx_scrapi/tools/agent_checker_util.py | 32 --------------------- 2 files changed, 2 insertions(+), 42 deletions(-) diff --git a/src/dfcx_scrapi/core/test_cases.py b/src/dfcx_scrapi/core/test_cases.py index f8ee504d..ed8ced4d 100644 --- a/src/dfcx_scrapi/core/test_cases.py +++ b/src/dfcx_scrapi/core/test_cases.py @@ -446,22 +446,14 @@ def _convert_flow(self, flow_id, flows_map): # Note that flow id includes agent, normally... def _convert_page(self, page_id, flow_id, pages_map): """Gets a page display name from a page and flow ID""" - special_page_dict = { - "END_SESSION": "End Session", - "END_FLOW": "End Flow", - "START_PAGE": "Start" - } - if page_id in special_page_dict: - return special_page_dict[page_id] - page_id_converted = str(flow_id) + "/pages/" + str(page_id) if flow_id in pages_map: # page_id is sometimes left empty for the test case if it starts # on the start page - return pages_map[flow_id].get(page_id_converted, "Start") + return pages_map[flow_id].get(page_id_converted, "START_PAGE") logging.info(f"Flow not found: {flow_id}") # TODO: Should throw error, but returning this probably will anyway - return "Invalid" + return "INVALID" def get_test_case_results_df(self, agent_id=None, retest_all=False): """Gets the test case results for this agent, diff --git a/src/dfcx_scrapi/tools/agent_checker_util.py b/src/dfcx_scrapi/tools/agent_checker_util.py index 1884587d..0a8a9cc3 100644 --- a/src/dfcx_scrapi/tools/agent_checker_util.py +++ b/src/dfcx_scrapi/tools/agent_checker_util.py @@ -174,38 +174,6 @@ def _get_all_route_group_data(self, delay): time.sleep(delay) return route_group_data - # Conversion utilities - # (Not currently used) - - def _convert_intent(self, intent_id): - """Gets an intent display name from an intent ID""" - intent_id_converted = str(self.agent_id) + "/intents/" + str(intent_id) - return self._intents_map.get(intent_id_converted, "") - - def _convert_flow(self, flow_id): - """Gets a flow display name from a flow ID""" - if flow_id.split("/")[-1] == "-": - return "" - # flow_id_converted = str(agent_id) + '/flows/' + str(flow_id) - return self._flows_map.get(flow_id, "Default Start Flow") - # TODO: Should throw error instead of returning default - - # Note that flow id includes agent, normally... - def _convert_page(self, page_id, flow_id): - """Gets a page display name from a page and flow ID""" - if page_id == "END_SESSION": - return "End Session" - elif page_id == "END_FLOW": - return "End Flow" - elif page_id == "START_PAGE": - return "Start" - page_id_converted = str(flow_id) + "/pages/" + str(page_id) - if flow_id in self._pages_map: - return self._pages_map[flow_id].get(page_id_converted, "Start") - logging.info("Flow not found") - # TODO: Should throw error, but returning this probably will anyway - return "Invalid" - def _get_intent_parameters(self, intent_name): """Gets the parameters for a particular intent, by display name""" for intent in self._intent_data: