Add test to ensure a Pyroma is a 10/10 Mascarpone

This commit is contained in:
hugovk 2014-06-28 23:48:14 +03:00
parent acfeeaa33f
commit d5bb962f83
2 changed files with 34 additions and 1 deletions

View File

@ -16,7 +16,7 @@ python:
install: install:
- "sudo apt-get -qq install libfreetype6-dev liblcms2-dev python-qt4 ghostscript libffi-dev cmake" - "sudo apt-get -qq install libfreetype6-dev liblcms2-dev python-qt4 ghostscript libffi-dev cmake"
- "pip install cffi" - "pip install cffi"
- "pip install coveralls nose" - "pip install coveralls nose pyroma"
- if [ "$TRAVIS_PYTHON_VERSION" == "2.6" ]; then pip install unittest2; fi - if [ "$TRAVIS_PYTHON_VERSION" == "2.6" ]; then pip install unittest2; fi
# webp # webp

33
Tests/test_pyroma.py Normal file
View File

@ -0,0 +1,33 @@
import unittest
try:
import pyroma
except ImportError:
# Skip via setUp()
pass
class TestPyroma(unittest.TestCase):
def setUp(self):
try:
import pyroma
except ImportError:
self.skipTest("ImportError")
def test_pyroma(self):
# Arrange
data = pyroma.projectdata.get_data(".")
# Act
rating = pyroma.ratings.rate(data)
# Assert
# Should have a perfect score
self.assertEqual(rating, (10, []))
if __name__ == '__main__':
unittest.main()
# End of file