Skip to content

Commit

Permalink
Add check-manifest as a Travis-CI check
Browse files Browse the repository at this point in the history
  • Loading branch information
MinchinWeb committed Oct 22, 2016
1 parent 65ebd4b commit e18fa05
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 11 deletions.
20 changes: 18 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ python:
env:
- UNIT_TESTS=true
- DOC_TESTS=true
- CHECK_MANIFEST=true
matrix:
allow_failures:
- python: 2.7
Expand All @@ -21,9 +22,12 @@ matrix:
fast_finish: true
exclude:
- env: DOC_TESTS=true
- env: CHECK_MANIFEST=true
include:
- python: 3.5
env: DOC_TESTS=true
- python: 3.5
env: CHECK_MANIFEST=true
# Cache Dependencies
cache: pip
before_install:
Expand All @@ -33,18 +37,24 @@ before_install:
- if [ "$DOC_TESTS" = "true" ]; then
echo "Running Code Style Tests";
fi
- if [ "$CHECK_MANIFEST" = "true" ]; then
echo "Checking Manifest.in";
fi
- printenv
# command to install dependencies
install:
- pip install --upgrade pip
- if [ "$UNIT_TESTS" = "true" ]; then
pip install -r requirements.txt;
pip install -r tests/requirements.txt;
pip install -r colourettu/tests/requirements.txt;
pip install coveralls;
fi
- if [ "$DOC_TESTS" = "true" ]; then
pip install isort pydocstyle pycodestyle;
fi
- if [ "$CHECK_MANIFEST" = "true" ]; then
pip install check-manifest;
fi
before_script:
- if [ "$UNIT_TESTS" = "true" ]; then
green --version;
Expand All @@ -54,10 +64,13 @@ before_script:
pydocstyle --version;
pycodestyle --version;
fi
- if [ "$CHECK_MANIFEST" = "true" ]; then
check-manifest --version;
fi
# command to run tests
script:
- if [ "$UNIT_TESTS" = "true" ]; then
green tests -vvr;
green colourettu.tests -vvr;
fi
- if [ "$DOC_TESTS" = "true" ]; then
isort --recursive colourettu --verbose;
Expand All @@ -68,6 +81,9 @@ script:
- if [ "$DOC_TESTS" = "true" ]; then
pycodestyle colourettu;
fi
- if [ "$CHECK_MANIFEST" = "true" ]; then
check-manifest -v;
fi
after_success:
- if [ "$UNIT_TESTS" = "true" ]; then
coveralls;
Expand Down
14 changes: 13 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
include requirements.txt
include *.py
include *.txt
include *.rst
include LICENSE
include tests
recursive-include colourettu *.txt
recursive-include docs *.bat
recursive-include docs *.ico
recursive-include docs *.png
recursive-include docs *.txt
recursive-include docs *.rst
recursive-include docs *.py
recursive-include tests *.py
recursive-include tests *.txt
prune docs/_build
6 changes: 3 additions & 3 deletions colourettu/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

from __future__ import absolute_import

import test_colour
import test_palette
import test_setup
from . import test_colour
from . import test_palette
from . import test_setup
11 changes: 6 additions & 5 deletions colourettu/tests/test_colour.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,29 +155,30 @@ def test_not_hex_string(self):
colour1 = colourettu.colour("dddd")

def test_bad_hex_chars(self):
'''Hex strings that don't contain only hex characters [0-9a-f] should raise error'''
'''Hex strings that don't contain only hex characters [0-9a-f]
should raise error'''
with self.assertRaises(ValueError):
colour1 = colourettu.colour('#asdfgh')

def test_bad_list_legnth(self):
'''Lists must be 3 long, otherwise raise error'''
with self.assertRaises(ValueError):
colour1 = colourettu.colour([1,1,1,1])
colour1 = colourettu.colour([1, 1, 1, 1])

def test_bad_tuple_legnth(self):
'''Tuples must be 3 long, otherwise raise error'''
with self.assertRaises(ValueError):
colour1 = colourettu.colour((1,1,1,1))
colour1 = colourettu.colour((1, 1, 1, 1))

def test_bad_list_value(self):
'''Lists my contain integer, otherwise raise error'''
with self.assertRaises(TypeError):
colour1 = colourettu.colour([1,2,"stuff"])
colour1 = colourettu.colour([1, 2, "stuff"])

def test_bad_Tuple_value(self):
'''Tuples my contain integer, otherwise raise error'''
with self.assertRaises(TypeError):
colour1 = colourettu.colour((1,2,"stuff"))
colour1 = colourettu.colour((1, 2, "stuff"))

def test_rgb_normalized_white(self):
'''Get normalized rgb tuple of white'''
Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ universal = 1
[isort]
known_first_party = colourettu
not_skip = __init__.py

[check-manifest]
ignore =
.editorconfig
make_release.py

0 comments on commit e18fa05

Please sign in to comment.