Browse Source

no cover the test code and a few other places...

main
John-Mark Gurney 2 years ago
parent
commit
4ddccd6fbd
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      ui/medashare/btv/bencode.py

+ 3
- 3
ui/medashare/btv/bencode.py View File

@@ -106,7 +106,7 @@ def bdecode(x, sloppy = 0):
raise ValueError("bad bencoded data")
return r

def test_bdecode():
def test_bdecode(): # pragma: no cover
try:
bdecode(b'0:0:')
assert 0
@@ -327,7 +327,7 @@ def test_bencode():
assert bencode({}) == b'de'
assert bencode({'age': 25, 'eyes': 'blue'}) == b'd3:agei25e4:eyes4:bluee'
assert bencode({'spam.mp3': {'author': 'Alice', 'length': 100000}}) == b'd8:spam.mp3d6:author5:Alice6:lengthi100000eee'
try:
try: # pragma: no cover
bencode({1: 'foo'})
assert 0
except (ValueError, AssertionError):
@@ -342,7 +342,7 @@ class _TestCases(unittest.TestCase):
def test_bdecode(self):
test_bdecode()

try:
try: #pragma: no cover
import psyco
psyco.bind(bdecode)
psyco.bind(bencode)


Loading…
Cancel
Save