tests: Added gen_colors test.

This commit is contained in:
Dylan Araps 2017-06-27 17:30:31 +10:00
parent 790ab71c50
commit 9e2fb01222
3 changed files with 28 additions and 1 deletions

0
tests/test.jpg Normal file
View File

27
tests/test_gen_colors.py Executable file
View File

@ -0,0 +1,27 @@
"""Test gen functions."""
import unittest
from pywal import gen_colors
from pywal import util
# Import colors.
COLORS = util.read_file("tests/test_file")
class TestGenColors(unittest.TestCase):
"""Test the gen_colors functions."""
def test_get_img(self):
"""> Validate image file."""
result = gen_colors.get_image("tests/test.jpg")
self.assertEqual(result, "tests/test.jpg")
def test_get_img_dir(self):
"""> Validate image directory."""
result = gen_colors.get_image("tests")
self.assertEqual(result, "tests/test.jpg")
if __name__ == "__main__":
unittest.main()

View File

@ -10,7 +10,7 @@ COLORS = util.read_file("tests/test_file")
class TestSetColors(unittest.TestCase):
"""Test the format_colors functions."""
"""Test the set_colors functions."""
def test_set_special(self):
"""> Create special escape sequence."""