Add tests and missing support files - make travis happy
This commit is contained in:
parent
eb97e7852d
commit
c655f12131
5
.coveragerc
Normal file
5
.coveragerc
Normal file
@ -0,0 +1,5 @@
|
||||
[report]
|
||||
omit =
|
||||
*/pyshared/*
|
||||
*/python?.?/*
|
||||
*/site-packages/nose/*
|
||||
21
.travis.yml
Normal file
21
.travis.yml
Normal 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"
|
||||
@ -1,7 +1,9 @@
|
||||
include .coveragerc
|
||||
include .travis.yml
|
||||
include AUTHORS
|
||||
include LICENSE
|
||||
include MANIFEST.in
|
||||
include README.rst
|
||||
include mopidy_musicbox_webclient/ext.conf
|
||||
|
||||
recursive-include mopidy_musicbox_webclient/static *
|
||||
recursive-include tests mopidy_musicbox_webclient/static *
|
||||
|
||||
@ -1,2 +1,6 @@
|
||||
[flake8]
|
||||
application-import-names = mopidy_musicbox_webclient,tests
|
||||
exclude = .git,.tox
|
||||
|
||||
[wheel]
|
||||
universal = 1
|
||||
|
||||
2
setup.py
2
setup.py
@ -20,7 +20,7 @@ setup(
|
||||
author_email='woutervanwijk@gmail.com',
|
||||
description='Mopidy MusicBox web extension',
|
||||
long_description=open('README.rst').read(),
|
||||
packages=find_packages(),
|
||||
packages=find_packages(exclude=['tests', 'tests.*']),
|
||||
zip_safe=False,
|
||||
include_package_data=True,
|
||||
install_requires=[
|
||||
|
||||
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
23
tests/test_extension.py
Normal file
23
tests/test_extension.py
Normal 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
24
tox.ini
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user