summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-06-27 17:30:31 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-06-27 17:30:31 +1000
commit9e2fb01222ddc06cc77675e8821eefe6c0101377 (patch)
tree0155120f9d7a3bd9db13f461145b4236fed5010e
parent790ab71c50ad4d7e695d4e868933363c4be090fa (diff)
tests: Added gen_colors test.
-rw-r--r--tests/test.jpg0
-rwxr-xr-xtests/test_gen_colors.py27
-rwxr-xr-xtests/test_set_colors.py2
3 files changed, 28 insertions, 1 deletions
diff --git a/tests/test.jpg b/tests/test.jpg
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/test.jpg
diff --git a/tests/test_gen_colors.py b/tests/test_gen_colors.py
new file mode 100755
index 0000000..e9fa5e2
--- /dev/null
+++ b/tests/test_gen_colors.py
@@ -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()
diff --git a/tests/test_set_colors.py b/tests/test_set_colors.py
index 5ff6b5c..3d3d800 100755
--- a/tests/test_set_colors.py
+++ b/tests/test_set_colors.py
@@ -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."""