Skip to content

Commit 67f94fe

Browse files
committed
Fix test suit
1 parent 26f0f84 commit 67f94fe

File tree

3 files changed

+29
-11
lines changed

3 files changed

+29
-11
lines changed

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include README.rst
2+
recursive-include tests *

setup.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,40 @@
88
try:
99
from Cython.Distutils import build_ext
1010
except ImportError:
11-
print("Could not import Cython.Distutils. Install `cython` and rerun.")
11+
print('Could not import Cython.Distutils. Install `cython` and rerun.')
1212
sys.exit(1)
1313

14-
ext_modules = [Extension("bencoder", ["bencoder.pyx"])]
14+
ext_modules = [Extension('bencoder', ['bencoder.pyx'])]
1515

1616
setup(
1717
name='bencoder.pyx',
1818
version='1.0.0',
1919
description='Yet another bencode implementation in Cython',
20-
long_description=open("README.rst", "r").read(),
20+
long_description=open('README.rst', 'r').read(),
2121
author='whtsky',
2222
author_email='whtsky@gmail.com',
2323
url='https://github.com/whtsky/bencoder.pyx',
24-
license="BSDv3",
24+
license='BSDv3',
2525
platforms=['POSIX', 'Windows'],
26+
zip_safe=False,
2627
keywords=['bencoding', 'encode', 'decode', 'bittorrent', 'bencode', 'bencoder', 'cython'],
2728
classifiers=[
28-
"Environment :: Other Environment",
29-
"Intended Audience :: Developers",
30-
"Operating System :: OS Independent",
31-
"Programming Language :: Python :: 2",
32-
"Programming Language :: Python :: 3",
33-
"Topic :: Software Development :: Libraries :: Python Modules",
29+
'Environment :: Other Environment',
30+
'Intended Audience :: Developers',
31+
'License :: OSI Approved :: BSD License',
32+
'Operating System :: OS Independent',
33+
'Programming Language :: Cython',
34+
'Programming Language :: Python',
35+
'Programming Language :: Python :: 2',
36+
'Programming Language :: Python :: 2.6',
37+
'Programming Language :: Python :: 2.7',
38+
'Programming Language :: Python :: 3',
39+
'Programming Language :: Python :: 3.3',
40+
'Programming Language :: Python :: 3.4',
41+
'Programming Language :: Python :: 3.5',
42+
'Programming Language :: Python :: Implementation :: CPython',
43+
'Programming Language :: Python :: Implementation :: PyPy',
44+
'Topic :: Software Development :: Libraries :: Python Modules',
3445
],
3546
cmdclass={'build_ext': build_ext},
3647
ext_modules=ext_modules,

tests/test_decode.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ def test_encode_complex():
3333

3434

3535
def test_decode_debian_torrent():
36-
with open("debian-8.3.0-amd64-netinst.iso.torrent", "rb") as f:
36+
import os
37+
torrent_path = os.path.join(
38+
os.path.abspath(os.path.dirname(__file__)),
39+
"debian-8.3.0-amd64-netinst.iso.torrent"
40+
)
41+
with open(torrent_path, "rb") as f:
3742
torrent = bdecode(f.read())
3843
assert torrent[b'announce'] == b'http://bttracker.debian.org:6969/announce'
3944
assert torrent[b'comment'] == b'"Debian CD from cdimage.debian.org"'

0 commit comments

Comments
 (0)