mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-02-27 07:31:13 +01:00
tests: Added gen_colors test.
This commit is contained in:
parent
790ab71c50
commit
9e2fb01222
0
tests/test.jpg
Normal file
0
tests/test.jpg
Normal file
27
tests/test_gen_colors.py
Executable file
27
tests/test_gen_colors.py
Executable 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()
|
@ -10,7 +10,7 @@ COLORS = util.read_file("tests/test_file")
|
|||||||
|
|
||||||
|
|
||||||
class TestSetColors(unittest.TestCase):
|
class TestSetColors(unittest.TestCase):
|
||||||
"""Test the format_colors functions."""
|
"""Test the set_colors functions."""
|
||||||
|
|
||||||
def test_set_special(self):
|
def test_set_special(self):
|
||||||
"""> Create special escape sequence."""
|
"""> Create special escape sequence."""
|
||||||
|
Loading…
Reference in New Issue
Block a user