From f88fbf551b3b34d74499fb32290388ead6c8a5ad Mon Sep 17 00:00:00 2001 From: Lee Render Date: Wed, 12 Apr 2023 14:17:12 +0800 Subject: [PATCH] rdrf #2449 mocking vis config --- rdrf/dashboards/testing.py | 46 ++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/rdrf/dashboards/testing.py b/rdrf/dashboards/testing.py index 1673bf14d..645e05e98 100644 --- a/rdrf/dashboards/testing.py +++ b/rdrf/dashboards/testing.py @@ -59,7 +59,40 @@ def create_traffic_light(self, data): vis_config = Mock() - data = None + config_dict = { + "fields": [ + "EORTCQLQC30_Q01", + "EORTCQLQC30_Q02", + "EORTCQLQC30_Q03", + "EORTCQLQC30_Q04", + "EORTCQLQC30_Q05", + "EORTCQLQC30_Q06", + "EORTCQLQC30_Q07", + "EORTCQLQC30_Q08", + "EORTCQLQC30_Q09", + "EORTCQLQC30_Q10", + "EORTCQLQC30_Q11", + "EORTCQLQC30_Q12", + "EORTCQLQC30_Q13", + "EORTCQLQC30_Q14", + "EORTCQLQC30_Q15", + "EORTCQLQC30_Q16", + "EORTCQLQC30_Q17", + "EORTCQLQC30_Q18", + "EORTCQLQC30_Q19", + "EORTCQLQC30_Q20", + "EORTCQLQC30_Q21", + "EORTCQLQC30_Q22", + "EORTCQLQC30_Q23", + "EORTCQLQC30_Q24", + "EORTCQLQC30_Q25", + "EORTCQLQC30_Q26", + "EORTCQLQC30_Q27", + "EORTCQLQC30_Q28", + ] + } + + vis_config.config = config_dict patient = Mock() return TrafficLights("crc test tl", vis_config, data, patient, None) @@ -75,11 +108,16 @@ def check_baseline(self, df): self.assertEqual(row["SEQ"], 0, "baseline row does not have SEQ 0") num_baselines += 1 - self.assertEqual(num_baselines, 1, f"Number of baseline rows is not 1: is {num_baselines}") - + self.assertEqual( + num_baselines, 1, f"Number of baseline rows is not 1: is {num_baselines}" + ) def check_followups(self, df): for index, row in df.iterrows(): if row["TYPE"] == "followup": seq = row["SEQ"] - self.assertGreater(seq, 0, f"followup seq number should be greater than 0. Actual={seq}") + self.assertGreater( + seq, + 0, + f"followup seq number should be greater than 0. Actual={seq}", + )