Add assertions for fields which are referenced in other functions.
parent
1aaf95fe9e
commit
28e9db15f5
|
@ -16,7 +16,16 @@ class EsmFeatures(unittest.TestCase):
|
||||||
|
|
||||||
def test_preprocess_esm(self):
|
def test_preprocess_esm(self):
|
||||||
self.esm_processed = preprocess_esm(self.esm)
|
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("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):
|
def test_classify_sessions_by_completion(self):
|
||||||
self.esm_classified_sessions = classify_sessions_by_completion(
|
self.esm_classified_sessions = classify_sessions_by_completion(
|
||||||
|
|
Loading…
Reference in New Issue