Skip to content

Commit

Permalink
fix: added missing __contains__ implementation for algopy.Bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-makerx committed Feb 19, 2025
1 parent 72427a3 commit 8b2efa2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/_algopy_testing/primitives/bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def __init__(self, value: bytes = b"") -> None:
check_type(value, bytes)
self.value = as_bytes(value)

def __contains__(self, item: Bytes | bytes) -> bool:
item_bytes = as_bytes(item)
return item_bytes in self.value

def __repr__(self) -> str:
return repr(self.value)

Expand Down

0 comments on commit 8b2efa2

Please # to comment.