Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use functional tests, python3 support (tox + py.test + lrzsz package) #8

Merged
merged 6 commits into from
Dec 31, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
*.pyc
/dist
/xmodem.egg-info
/.coverage
/.tox
*.py.swp
27 changes: 20 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
language: python
python:
- "2.6"
- "2.7"
# install required packages

env:
- TOXENV=py26
- TOXENV=py27
- TOXENV=py33
- TOXENV=pypy
- TOXENV=py34

install:
- sudo apt-get install lrzsz
# command to run tests
- pip install -q tox coveralls
- sudo apt-get install -qq -y lrzsz

script:
- make tests
- tox -e $TOXENV

after_success:
- coveralls

notifications:
email:
- contact@jeffquast.com
- maze@pyth0n.org
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
tests:
PYTHONPATH=. python test/test.py test/test.py
PYTHONPATH=. python test/test-recv.py
PYTHONPATH=. python test/test-send.py
tox

upload:
python setup.py sdist upload
Expand Down
3 changes: 3 additions & 0 deletions requirements-testing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest-cov
pytest
tox
Empty file added test/functional/__init__.py
Empty file.
29 changes: 29 additions & 0 deletions test/functional/accessories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import subprocess


def _multi_which(prog_names):
for prog_name in prog_names:
proc = subprocess.Popen(('which', prog_name), stdout=subprocess.PIPE)
stdout, stderr = proc.communicate()
if proc.returncode == 0:
return stdout.strip()
return None


def _get_recv_program():
bin_path = _multi_which(('rb', 'lrb'))
assert bin_path is not None, (
"program required: {0!r}. "
"Try installing lrzsz package.".format(bin_path))
return bin_path


def _get_send_program():
bin_path = _multi_which(('sb', 'lsb'))
assert bin_path is not None, (
"program required: {0!r}. "
"Try installing lrzsz package.".format(bin_path))
return bin_path

recv_prog = _get_recv_program()
send_prog = _get_send_program()
42 changes: 0 additions & 42 deletions test/functional/test-recv.py

This file was deleted.

48 changes: 0 additions & 48 deletions test/functional/test-send.py

This file was deleted.

Loading