Skip to content

Commit 682055e

Browse files
committed
Decode Debian's torrent file in decode test
1 parent 31b1b0b commit 682055e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
19.7 KB
Binary file not shown.

tests/test_decode.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,10 @@ def test_encode_complex():
3030
od[b'KeyD'] = b'AString'
3131
expected_result = b'd4:KeyAl9:listitemAd1:k1:vei3ee4:KeyBd1:k1:ve4:KeyCi3e4:KeyD7:AStringe'
3232
assert bdecode(expected_result) == od
33+
34+
35+
def test_decode_debian_torrent():
36+
with open("debian-8.3.0-amd64-netinst.iso.torrent", "rb") as f:
37+
torrent = bdecode(f.read())
38+
assert torrent[b'announce'] == b'http://bttracker.debian.org:6969/announce'
39+
assert torrent[b'comment'] == b'"Debian CD from cdimage.debian.org"'

0 commit comments

Comments
 (0)