mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-20 17:52:50 +00:00
A more explicit test.
This commit is contained in:
parent
2b89674052
commit
d316ad3ebd
@ -8,6 +8,10 @@ from allmydata.util.netstring import netstring, split_netstring
|
||||
|
||||
|
||||
class Netstring(unittest.TestCase):
|
||||
def test_encode(self):
|
||||
"""netstring() correctly encodes the given bytes."""
|
||||
self.assertEqual(netstring(b"abc"), b"3:abc,")
|
||||
|
||||
def test_split(self):
|
||||
a = netstring(b"hello") + netstring(b"world")
|
||||
self.failUnlessEqual(split_netstring(a, 2), ([b"hello", b"world"], len(a)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user