From 28e9db15f55a0e9e703c2e6cfd64eeeee742885c Mon Sep 17 00:00:00 2001 From: junos Date: Tue, 27 Jul 2021 14:05:48 +0200 Subject: [PATCH] Add assertions for fields which are referenced in other functions. --- test/test_esm.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/test_esm.py b/test/test_esm.py index 1bf5fb9..ddfee37 100644 --- a/test/test_esm.py +++ b/test/test_esm.py @@ -16,7 +16,16 @@ class EsmFeatures(unittest.TestCase): def test_preprocess_esm(self): self.esm_processed = preprocess_esm(self.esm) + # Check for columns which should have been extracted from esm_json. self.assertIn("question_id", self.esm_processed) + self.assertIn("questionnaire_id", self.esm_processed) + self.assertIn("esm_instructions", self.esm_processed) + self.assertIn("esm_type", self.esm_processed) + self.assertIn("time", self.esm_processed) + # Check for explicitly added column. + self.assertIn("datetime_lj", self.esm_processed) + # All of these keys are referenced in other functions, so they are expected to be present in preprocessed ESM. + # Since all of these are added in a single function, it should be OK to have many assert statements in one test. def test_classify_sessions_by_completion(self): self.esm_classified_sessions = classify_sessions_by_completion(