Exemple #1
0
 def test_all_lambda_constants(self):
     self.assertEqual(len(Constants.LOAD_TYPES()), 2)
     self.assertEqual(Constants.LOAD_TYPES(), [
         Constants.LOAD_TYPE_ASSESSMENT,
         Constants.LOAD_TYPE_STUDENT_REGISTRATION
     ])
     self.assertEqual(len(Constants.ASSESSMENT_TYPES()), 3)
     self.assertEqual(Constants.ASSESSMENT_TYPES(), [
         Constants.ASSESSMENT_TYPE_SUMMATIVE,
         Constants.ASSESSMENT_TYPE_INTERIM_COMPREHENSIVE,
         Constants.ASSESSMENT_TYPE_INTERIM_ASSESSMENT_BLOCKS
     ])
     self.assertEqual(
         Constants.UDL2_STAGING_TABLE(Constants.LOAD_TYPE_ASSESSMENT),
         Constants.STG_ASMT_OUT_TABLE)
     self.assertEqual(
         Constants.UDL2_STAGING_TABLE(
             Constants.LOAD_TYPE_STUDENT_REGISTRATION),
         Constants.STG_SR_TABLE)
     self.assertEqual(
         Constants.UDL2_INTEGRATION_TABLE(Constants.LOAD_TYPE_ASSESSMENT),
         Constants.INT_ASMT_OUT_TABLE)
     self.assertEqual(
         Constants.UDL2_INTEGRATION_TABLE(
             Constants.LOAD_TYPE_STUDENT_REGISTRATION),
         Constants.INT_SR_TABLE)
     self.assertEqual(
         Constants.UDL2_JSON_INTEGRATION_TABLE(
             Constants.LOAD_TYPE_ASSESSMENT), Constants.INT_ASMT_TABLE)
     self.assertEqual(
         Constants.UDL2_JSON_INTEGRATION_TABLE(
             Constants.LOAD_TYPE_STUDENT_REGISTRATION),
         Constants.INT_SR_META_TABLE)
     self.assertEqual(
         Constants.UDL2_REF_MAPPING_TABLE(Constants.LOAD_TYPE_ASSESSMENT),
         Constants.ASMT_REF_TABLE)
     self.assertEqual(
         Constants.UDL2_REF_MAPPING_TABLE(
             Constants.LOAD_TYPE_STUDENT_REGISTRATION),
         Constants.SR_REF_TABLE)
     self.assertEqual(Constants.TENANT_SEQUENCE_NAME('cat'),
                      Constants.SEQUENCE_NAME + '_' + 'cat')
     self.assertEqual(Constants.TENANT_SEQUENCE_NAME(''), None)
     self.assertEqual(Constants.TENANT_SEQUENCE_NAME(None), None)
def get_assessment_type(json_file_dir):
    """
    Get the assessment type for the UDL job from the json file
    @param json_file_dir: A directory that houses the json file
    @return: UDL job assessment type
    @rtype: string
    """
    assessment_types = Constants.ASSESSMENT_TYPES()
    assessment_type = get_value_from_json(json_file_dir,
                                          Constants.ASSESSMENT_TYPE_KEY)
    if assessment_type not in assessment_types:
        raise ValueError('No valid load type specified in json file --')
    return assessment_type