|
|
@@ -57,7 +57,7 @@ def decode_string(x, f): |
|
|
|
colon += 1 |
|
|
|
return (x[colon:colon+n], colon+n) |
|
|
|
|
|
|
|
def decode_unicode(x, f): |
|
|
|
def decode_unicode(x, f): # pragma: no cover |
|
|
|
s, f = decode_string(x, f+1) |
|
|
|
return (s.decode('UTF-8'),f) |
|
|
|
|
|
|
@@ -332,6 +332,14 @@ def test_bencode(): |
|
|
|
except (ValueError, AssertionError): |
|
|
|
pass |
|
|
|
|
|
|
|
import unittest |
|
|
|
|
|
|
|
class _TestCases(unittest.TestCase): |
|
|
|
def test_bencode(self): |
|
|
|
test_bencode() |
|
|
|
|
|
|
|
def test_bdecode(self): |
|
|
|
test_bdecode() |
|
|
|
|
|
|
|
try: |
|
|
|
import psyco |
|
|
|