Permalink
Browse files

Structure of tests (via pytest)

  • Loading branch information...
Ben Hoyt Ben Hoyt
Ben Hoyt authored and Ben Hoyt committed Mar 2, 2017
1 parent 55e56ed commit f9b4320e904bf0c69df55397affcd3dd6e67dca9
Showing with 74 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +2 −0 setup.cfg
  3. +54 −0 setup.py
  4. +15 −0 tests/test_upload.py
View
@@ -1,2 +1,5 @@
__pycache__/
*.pyc
.cache
cdnupload.egg-info/
output/
View
@@ -0,0 +1,2 @@
[aliases]
test=pytest
View
@@ -0,0 +1,54 @@
"""Run 'python setup.py install' to install cdnupload."""
import os
import re
from distutils.core import setup
# Because it's best not to import the module in setup.py
with open(os.path.join(os.path.dirname(__file__), 'cdnupload.py')) as f:
for line in f:
match = re.match(r"__version__.*'([0-9.]+)'", line)
if match:
version = match.group(1)
break
else:
raise Exception("Couldn't find __version__ line in cdnupload.py")
# Read long_description from README.rst
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
long_description = f.read()
setup(
name='cdnupload',
version=version,
author='Ben Hoyt',
author_email='benhoyt@gmail.com',
url='https://cdnupload.com/',
license='TODO',
description='Upload static files from given source directory to '
'destination directory or Amazon S3 bucket, with content-'
'based hash in filenames for versioning.',
long_description=long_description,
py_modules=['cdnupload'],
# TODO: requires boto3 / optional
setup_requires=['pytest-runner'],
tests_require=['pytest'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
#TODO 'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
#TODO 'Topic :: Multimedia :: Graphics',
]
)
View
@@ -0,0 +1,15 @@
#
import cdnupload
def test_upload():
assert True
def test_good():
pass
def test_other():
assert False

0 comments on commit f9b4320

Please sign in to comment.