Add tests and missing support files - make travis happy

This commit is contained in:
kingosticks 2015-03-05 22:53:22 +00:00
parent eb97e7852d
commit c655f12131
8 changed files with 81 additions and 2 deletions

5
.coveragerc Normal file
View File

@ -0,0 +1,5 @@
[report]
omit =
*/pyshared/*
*/python?.?/*
*/site-packages/nose/*

21
.travis.yml Normal file
View File

@ -0,0 +1,21 @@
language: python
python:
- "2.7_with_system_site_packages"
env:
- TOX_ENV=py27
- TOX_ENV=flake8
install:
- "wget -O - http://apt.mopidy.com/mopidy.gpg | sudo apt-key add -"
- "sudo wget -O /etc/apt/sources.list.d/mopidy.list http://apt.mopidy.com/mopidy.list"
- "sudo apt-get update || true"
- "sudo apt-get install mopidy"
- "pip install tox"
script:
- "tox -e $TOX_ENV"
after_success:
- "if [ $TOX_ENV == 'py27' ]; then pip install coveralls; coveralls; fi"

View File

@ -1,7 +1,9 @@
include .coveragerc
include .travis.yml
include AUTHORS include AUTHORS
include LICENSE include LICENSE
include MANIFEST.in include MANIFEST.in
include README.rst include README.rst
include mopidy_musicbox_webclient/ext.conf include mopidy_musicbox_webclient/ext.conf
recursive-include mopidy_musicbox_webclient/static * recursive-include tests mopidy_musicbox_webclient/static *

View File

@ -1,2 +1,6 @@
[flake8]
application-import-names = mopidy_musicbox_webclient,tests
exclude = .git,.tox
[wheel] [wheel]
universal = 1 universal = 1

View File

@ -20,7 +20,7 @@ setup(
author_email='woutervanwijk@gmail.com', author_email='woutervanwijk@gmail.com',
description='Mopidy MusicBox web extension', description='Mopidy MusicBox web extension',
long_description=open('README.rst').read(), long_description=open('README.rst').read(),
packages=find_packages(), packages=find_packages(exclude=['tests', 'tests.*']),
zip_safe=False, zip_safe=False,
include_package_data=True, include_package_data=True,
install_requires=[ install_requires=[

0
tests/__init__.py Normal file
View File

23
tests/test_extension.py Normal file
View File

@ -0,0 +1,23 @@
from __future__ import unicode_literals
from mopidy_musicbox_webclient import MusicBoxExtension
def test_get_default_config():
ext = MusicBoxExtension()
config = ext.get_default_config()
assert '[musicbox_webclient]' in config
assert 'enabled = true' in config
def test_get_config_schema():
ext = MusicBoxExtension()
schema = ext.get_config_schema()
# TODO Test the content of your config schema
# TODO Write more tests

24
tox.ini Normal file
View File

@ -0,0 +1,24 @@
[tox]
envlist = py27, flake8
[testenv]
sitepackages = true
deps =
mock
mopidy==dev
pytest
pytest-cov
pytest-xdist
install_command = pip install --allow-unverified=mopidy --pre {opts} {packages}
commands =
py.test \
--basetemp={envtmpdir} \
--junit-xmlfile=xunit-{envname}.xml \
--cov=mopidy_musicbox_webclient --cov-report=term-missing \
{posargs}
[testenv:flake8]
deps =
flake8
flake8-import-order
commands = flake8