def test_update_assignment(self):
     a_id = 1
     description = "homework"
     deadline = "10-10-2010"
     assignment = Assignment(a_id, description, deadline)
     assignment.set_assignment_description("lola")
     assert (assignment.get_assignment_description() == "lola")
     assignment.set_assignment_deadline("20.12.2019")
     assert (assignment.get_assignment_deadline() == "20.12.2019")
 def test_create_assignment(self):
     a_id = 1
     description = "homework"
     deadline = "10-10-2010"
     assignment = Assignment(a_id, description, deadline)
     assert (assignment.get_id() == 1)
     assert (assignment.get_assignment_description() == description)
     assert (assignment.get_assignment_deadline() == deadline)
     assignment.set_assignment_description("tema")
     assert (assignment.get_assignment_description() == "tema")
     dif_assign_same_id = Assignment(1, "diefie", "10.10.2000")
     assert (assignment == dif_assign_same_id)
Exemple #3
0
 def update_assignment(self, assignment_id, assignment_description, assignment_deadline):
     """
     function that update the description and the deadline of an assignment
     :param assignment_id: integer
     :param assignment_description: string
     :param assignment_deadline: date
     :return: -
     """
     assignment = Assignment(assignment_id, None, None)
     assignment = self.__repo_assignment.search(assignment)
     self.__repo_assignment.remove(assignment)
     if assignment_description is not None:
         assignment.set_assignment_description(assignment_description)
     if assignment_deadline is not None:
         assignment.set_assignment_deadline(assignment_deadline)
     self.__repo_assignment.add(assignment)