Skip to content

Commit ac912da

Browse files
committed
Add test for __bytes__ method of StringList
1 parent a75e7aa commit ac912da

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_stringlist.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,12 @@ def test_str(self):
416416
sl = StringList(['', '', "hello", "world", '', '', '', "1234", ''])
417417
assert str(sl) == "\n\nhello\nworld\n\n\n\n1234\n"
418418

419+
def test_bytes(self):
420+
sl = StringList(['', '', "hello", "world", '', '', '', "1234"])
421+
assert bytes(sl) == b"\n\nhello\nworld\n\n\n\n1234"
422+
sl = StringList(['', '', "hello", "world", '', '', '', "1234", ''])
423+
assert bytes(sl) == b"\n\nhello\nworld\n\n\n\n1234\n"
424+
419425
@pytest.mark.xfail()
420426
def test_pickle(self):
421427
sl = StringList(['', '', "hello", "world", '', '', '', "1234"])

0 commit comments

Comments
 (0)