Add assertions for fields which are referenced in other functions.

communication
junos 2021-07-27 14:05:48 +02:00
parent 1aaf95fe9e
commit 28e9db15f5
1 changed files with 9 additions and 0 deletions

View File

@ -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(