Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit 613dee8

Browse files
committed
additional tests
1 parent 291d4e9 commit 613dee8

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

test/test_unit.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,38 @@ def test_fam_array_get_all_g2():
778778
fam.get_all(np.array([b"dd", b"x"]))
779779

780780

781+
def test_fam_array_get_all_h():
782+
a1 = np.array((b"a", b""))
783+
a1.flags.writeable = False
784+
fam = FrozenAutoMap(a1)
785+
786+
post = fam.get_all(np.array([b"", b"", b"a"]))
787+
assert post.tolist() == [1, 1, 0]
788+
789+
790+
def test_fam_array_get_all_i():
791+
a1 = np.array((b"foo", b"bar"))
792+
a1.flags.writeable = False
793+
fam = FrozenAutoMap(a1)
794+
with pytest.raises(KeyError):
795+
_ = fam.get_all(np.array([b"fo", b"ba"]))
796+
797+
with pytest.raises(KeyError):
798+
_ = fam.get_all(np.array([b"", b""]))
799+
800+
801+
def test_fam_array_get_all_j():
802+
a1 = np.array(("aaaaa", "bb", "ccc", "dd"))
803+
a1.flags.writeable = False
804+
fam = FrozenAutoMap(a1)
805+
806+
with pytest.raises(KeyError):
807+
_ = fam.get_all(np.array(["a", "b"]))
808+
809+
assert fam.get_all(np.array(("bb", "dd", "bb", "dd"))).tolist() == [1, 3, 1, 3]
810+
811+
812+
781813
# -------------------------------------------------------------------------------
782814

783815

0 commit comments

Comments
 (0)