chiark
/
gitweb
/
~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
t/t-rand.py: Set the correct refernce seed value for `dsarand'.
[catacomb-python]
/
t
/
t-buffer.py
diff --git
a/t/t-buffer.py
b/t/t-buffer.py
index 24823c65d2fccb993d1dc024d161b1959caa30a0..096e35b479134b2d9dfd0a9357a078155a36869b 100644
(file)
--- a/
t/t-buffer.py
+++ b/
t/t-buffer.py
@@
-180,11
+180,10
@@
class TestWriteBuffer (U.TestCase):
buf.putu8(0x00)
putfn(buf, T.bytes_as_int(w, bigendp))
buf.putu8(w + 1)
buf.putu8(0x00)
putfn(buf, T.bytes_as_int(w, bigendp))
buf.putu8(w + 1)
- me.assertEqual(
C.ByteString(buf)
, T.span(w + 2))
- me.assertEqual(
C.ByteString(putfn(C.WriteBuffer(), (1 << 8*w) - 1))
,
+ me.assertEqual(
buf.contents
, T.span(w + 2))
+ me.assertEqual(
putfn(C.WriteBuffer(), (1 << 8*w) - 1).contents
,
w*C.bytes("ff"))
w*C.bytes("ff"))
- me.assertEqual(C.ByteString(putfn(C.WriteBuffer(), C.MP(0))),
- w*C.bytes("00"))
+ me.assertEqual(putfn(C.WriteBuffer(), C.MP(0)).contents, w*C.bytes("00"))
## Check overflow detection.
me.assertRaises((OverflowError, ValueError),
## Check overflow detection.
me.assertRaises((OverflowError, ValueError),
@@
-196,8
+195,8
@@
class TestWriteBuffer (U.TestCase):
## Go through a number of different sizes.
for n in [0, 1, 7, 8, 19, 255, 12345, 65535, 123456]:
if n >= 1 << 8*w: continue
## Go through a number of different sizes.
for n in [0, 1, 7, 8, 19, 255, 12345, 65535, 123456]:
if n >= 1 << 8*w: continue
- me.assertEqual(
C.ByteString(
putfn(C.WriteBuffer().putu8(0x00),
-
T.span(n)).putu8(0xff))
,
+ me.assertEqual(putfn(C.WriteBuffer().putu8(0x00),
+
T.span(n)).putu8(0xff).contents
,
T.prep_lenseq(w, n, bigendp, True))
## Check blocks which are too large for the length prefix.
T.prep_lenseq(w, n, bigendp, True))
## Check blocks which are too large for the length prefix.
@@
-244,7
+243,7
@@
class TestWriteBuffer (U.TestCase):
buf.zero(17)
buf.put(T.span(23))
me.assertEqual(buf.size, 40)
buf.zero(17)
buf.put(T.span(23))
me.assertEqual(buf.size, 40)
- me.assertEqual(
C.ByteString(buf)
, C.ByteString.zero(17) + T.span(23))
+ me.assertEqual(
buf.contents
, C.ByteString.zero(17) + T.span(23))
###----- That's all, folks --------------------------------------------------
###----- That's all, folks --------------------------------------------------