tests: net: lib: lwm2m: interop: Fix strip-with-multi-characters (B005)

All strip functions remove any of the provided characters instead of a
prefix/suffix. This is likely a bug.

See https://docs.astral.sh/ruff/rules/strip-with-multi-characters/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
Pieter De Gendt 2024-11-13 08:39:54 +01:00 committed by Anas Nashif
commit 175bfb4bc9

View file

@ -455,7 +455,7 @@ class LeshanEventsIterator:
for line in self._it:
if not line.startswith('data: '):
continue
data = json.loads(line.lstrip('data: '))
data = json.loads(line.removeprefix('data: '))
if event == 'SEND' or (event == 'NOTIFICATION' and data['kind'] == 'composite'):
return Leshan.parse_composite(data['val'])
if event == 'NOTIFICATION':