Skip to content

Commit 90ac931

Browse files
committed
Improved tests for from_text methods [skip ci]
1 parent 6c8276d commit 90ac931

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎tests/test_bit.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ def test_from_text(self) -> None:
106106
def test_from_text_zero_length(self) -> None:
107107
assert Bit.from_text('') == Bit([])
108108

109+
def test_from_text_invalid_character(self) -> None:
110+
with pytest.raises(ValueError, match='expected bit string'):
111+
Bit.from_text('2')
112+
109113
def test_from_binary(self) -> None:
110114
data = struct.pack('>iB', 3, 5 << 5)
111115
vec = Bit.from_binary(data)

0 commit comments

Comments
 (0)