mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 17:06:16 +03:00
Add test to ensure a Pyroma is a 10/10 Mascarpone
This commit is contained in:
parent
acfeeaa33f
commit
d5bb962f83
|
@ -16,7 +16,7 @@ python:
|
|||
install:
|
||||
- "sudo apt-get -qq install libfreetype6-dev liblcms2-dev python-qt4 ghostscript libffi-dev cmake"
|
||||
- "pip install cffi"
|
||||
- "pip install coveralls nose"
|
||||
- "pip install coveralls nose pyroma"
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" == "2.6" ]; then pip install unittest2; fi
|
||||
|
||||
# webp
|
||||
|
|
33
Tests/test_pyroma.py
Normal file
33
Tests/test_pyroma.py
Normal 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
|
Loading…
Reference in New Issue
Block a user