Skip to content

Commit

Permalink
tests: net: lib: lwm2m: interop: Fix strip-with-multi-characters (B005)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pdgendt authored and nashif committed Nov 16, 2024
1 parent 8f14c68 commit 175bfb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/net/lib/lwm2m/interop/pytest/leshan.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def next_event(self, event: str):
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':
Expand Down

0 comments on commit 175bfb4

Please sign in to comment.