Skip to content

Commit 7329d8a

Browse files
committed
Added more tests for zero length bit [skip ci]
1 parent 2915a59 commit 7329d8a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎tests/test_bit.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ class TestBit:
99
def test_list(self) -> None:
1010
assert Bit([True, False, True]).to_list() == [True, False, True]
1111

12+
def test_list_empty(self) -> None:
13+
assert Bit([]).to_list() == []
14+
1215
def test_list_none(self) -> None:
1316
with pytest.raises(ValueError) as error:
1417
Bit([True, None, True]) # type: ignore
@@ -39,6 +42,9 @@ def test_bytes(self) -> None:
3942
assert Bit(b'\xff\x00\xf0').to_text() == '111111110000000011110000'
4043
assert Bit(b'\xfe\x07\x00').to_text() == '111111100000011100000000'
4144

45+
def test_bytes_empty(self) -> None:
46+
assert Bit(b'').to_text() == ''
47+
4248
def test_ndarray(self) -> None:
4349
if np is None:
4450
pytest.skip('NumPy required')

0 commit comments

Comments
 (0)