From a42efda90c24f8e6933bfd3e50fb94e6b9a73d5b Mon Sep 17 00:00:00 2001 From: Giorgio Salluzzo Date: Tue, 3 Sep 2024 11:20:45 +0200 Subject: [PATCH] Small refactor. --- mocket/mockhttp.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mocket/mockhttp.py b/mocket/mockhttp.py index a5b47cac..fceb831f 100644 --- a/mocket/mockhttp.py +++ b/mocket/mockhttp.py @@ -35,8 +35,7 @@ def add_data(self, data): @property def event(self): if not self._event: - event = self._parser.next_event() - self._event = event + self._event = self._parser.next_event() return self._event @cached_property @@ -67,8 +66,7 @@ def body(self): if isinstance(event, H11Request): self._event = event elif isinstance(event, Data): - break - return event.data.decode(ENCODING) + return event.data.decode(ENCODING) def __str__(self): return f"{self.method} - {self.path} - {self.headers}"