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")
Exemple #2
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)