|
@@ -55,7 +55,7 @@ class DatasetTester:
|
|
|
children = children[children['ses'] != 'NA']
|
|
|
children['ses'] = children['ses'].astype(int)
|
|
|
|
|
|
- assert (children['ses'].values >= 1).all() and (children['ses'].values <= 5).all()
|
|
|
+ assert (children['ses'].values >= 1).all() and (children['ses'].values <= 5).all(), "ses should be >= 1 and <= 5"
|
|
|
|
|
|
def test_language(self):
|
|
|
children = self.project.children.copy()
|
|
@@ -81,8 +81,13 @@ class DatasetTester:
|
|
|
else:
|
|
|
raise KeyError("neither 'languages' or 'language' present in the metadata")
|
|
|
|
|
|
+ if 'monoling' in children.columns:
|
|
|
+ assert children['monoling'].str.lower().isin(['y', 'n']), "monoling not always y or n"
|
|
|
+ else:
|
|
|
+ raise KeyError("missing 'monoling' field")
|
|
|
+
|
|
|
def test_sex(self):
|
|
|
children = self.project.children.copy()
|
|
|
|
|
|
children['child_sex'] = children['child_sex'].str.lower()
|
|
|
- assert children['child_sex'].isin(['m', 'f']).all()
|
|
|
+ assert children['child_sex'].isin(['m', 'f']).all(), "children sex not always m or f"
|