Adds get_summary to extended appointment

The Watcher used to create the summary, but that was not modular enough and introduced issues when testing
This commit is contained in:
Sergi Delgado Segura
2020-04-19 19:33:29 +02:00
parent 2e6095971d
commit 66dce42526
2 changed files with 13 additions and 3 deletions

View File

@@ -6,6 +6,15 @@ class ExtendedAppointment(Appointment):
super().__init__(locator, to_self_delay, encrypted_blob)
self.user_id = user_id
def get_summary(self):
"""
Returns the summary of an appointment, consisting on the locator, the user_id and the appointment size.
Returns:
:obj:`dict`: the appointment summary.
"""
return {"locator": self.locator, "user_id": self.user_id, "size": len(self.encrypted_blob)}
@classmethod
def from_dict(cls, appointment_data):
"""