|
|
@@ -76,6 +76,16 @@ def datagram_large():
|
|
|
|
|
|
return dg, readback_function
|
|
|
|
|
|
+def test_datagram_bytes():
|
|
|
+ """Tests that we can put and get a bytes object on Datagram."""
|
|
|
+ dg = core.Datagram(b'abc\x00')
|
|
|
+ dg.append_data(b'\xff123')
|
|
|
+ assert bytes(dg) == b'abc\x00\xff123'
|
|
|
+
|
|
|
+ dgi = core.DatagramIterator(dg)
|
|
|
+ dgi.get_remaining_bytes() == b'abc\x00\xff123'
|
|
|
+
|
|
|
+
|
|
|
def test_iterator(datagram_small):
|
|
|
"""This tests Datagram/DatagramIterator, and sort of serves as a self-check
|
|
|
of the test fixtures too."""
|