Beispiel #1
0
    def delete_success(self):
        oid = subject_bll.insert("Asignatura Muy Nueva", "AMN", 6, 3,
                                 "Obligatoria", 1, 1)
        subject = subject_dal.get_by_name("Asignatura Muy Nueva")

        if subject is None:
            raise BLLException("The subject was not created")

        subject_bll.delete(oid)

        subject = subject_dal.get_by_name("Asignatura Muy Nueva")
        if subject is not None:
            raise BLLException("The subject hasn't been deleted")
Beispiel #2
0
def insert() -> Tuple[Response, int]:
    """Creates a new subject"""
    subject_fields: tuple = get_fields()

    res: Tuple[Response, int]

    try:
        oid: int = subject_bll.insert(*subject_fields)
        res = jsonify({"oid": oid}), 200
    except BLLException as exc:
        error = {"error": str(exc)}
        res = jsonify(error), 400

    return res
Beispiel #3
0
 def create_incorrect_type(self):
     subject_bll.insert("Asignatura Muy Nueva", "AMN", 6, 3, "Inexistente",
                        1, 1)
Beispiel #4
0
 def create_incorrect_course(self):
     subject_bll.insert("Asignatura Muy Nueva", "AMN", 6, 7, "Obligatoria",
                        1, 1)
Beispiel #5
0
 def create_incorrect_credits(self):
     subject_bll.insert("Asignatura Muy Nueva", "AMN", 0, 3, "Obligatoria",
                        1, 1)
Beispiel #6
0
 def create_same_acronym(self):
     subject_bll.insert("Asignatura Muy Nueva", "FP", 6, 3, "Obligatoria",
                        1, 1)
Beispiel #7
0
 def create_incorrect_acronym(self):
     subject_bll.insert("Asignatura Muy Nueva", " ", 6, 3, "Obligatoria", 1,
                        1)
Beispiel #8
0
 def create_same_name(self):
     subject_bll.insert("Fundamentos de programación", "AMN", 6, 3,
                        "Obligatoria", 1, 1)
Beispiel #9
0
 def create_incorrect_name(self):
     subject_bll.insert(" ", "AMN", 6, 3, "Obligatoria", 1, 1)
Beispiel #10
0
 def create_success(self):
     subject_bll.insert("Asignatura Muy Nueva", "AMN", 6, 3, "Obligatoria",
                        1, 1)