Skip to content

Commit 4c9f97c

Browse files
committed
add test for FixedBytes in Bytes
1 parent b16899e commit 4c9f97c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/_algopy_testing/primitives/bytes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
if TYPE_CHECKING:
88
from collections.abc import Iterator
99

10+
from _algopy_testing.primitives.fixed_bytes import FixedBytes
11+
1012

1113
from itertools import zip_longest
1214

@@ -27,7 +29,7 @@ def __init__(self, value: bytes = b"") -> None:
2729
check_type(value, bytes)
2830
self.value = as_bytes(value)
2931

30-
def __contains__(self, item: Bytes | bytes) -> bool:
32+
def __contains__(self, item: Bytes | FixedBytes | bytes) -> bool: # type: ignore[type-arg]
3133
item_bytes = as_bytes(item)
3234
return item_bytes in self.value
3335

tests/primitives/test_fixed_bytes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ def test_fixed_bytes_contains_with_bytes(
543543
fb = FixedBytes[typing.Literal[11]](haystack)
544544

545545
assert (needle in fb) is expected_contains
546+
assert fb in Bytes(haystack)
546547

547548

548549
def test_fixed_bytes_contains_with_bytes_object() -> None:

0 commit comments

Comments
 (0)