summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-07-23 21:29:38 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-07-23 21:29:38 +1000
commit5f6de5efe82764c141019e47b488e5def62ca4c2 (patch)
treee7fabc1396a67f5fec3c5e36013b7d4c427028bc
parente8475c05ea28205a02afe84b591133cf0963956c (diff)
tests: Fix errors
-rwxr-xr-xtests/test_colors.py8
-rw-r--r--tests/test_image.py2
2 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_colors.py b/tests/test_colors.py
index 52957fd..5765370 100755
--- a/tests/test_colors.py
+++ b/tests/test_colors.py
@@ -2,16 +2,20 @@
import unittest
import unittest.mock
import io
+import pathlib
from pywal import colors
+CACHE_DIR = pathlib.Path("/tmp/wal")
+
+
class TestGenColors(unittest.TestCase):
"""Test the gen_colors functions."""
def test_gen_colors(self):
"""> Generate a colorscheme."""
- result = colors.get("tests/test_files/test.jpg")
+ result = colors.get("tests/test_files/test.jpg", CACHE_DIR)
self.assertEqual(len(result["colors"]["color0"]), 7)
def test_gen_colors_fail(self):
@@ -25,7 +29,7 @@ class TestGenColors(unittest.TestCase):
# it's output so that we can read it.
message = "colors: Found cached colorscheme."
with unittest.mock.patch('sys.stdout', new=io.StringIO()) as fake_out:
- colors.get("tests/test_files/test.jpg")
+ colors.get("tests/test_files/test.jpg", CACHE_DIR)
self.assertEqual(fake_out.getvalue().strip(), message)
def test_color_import(self):
diff --git a/tests/test_image.py b/tests/test_image.py
index 1cf7ec6..195951d 100644
--- a/tests/test_image.py
+++ b/tests/test_image.py
@@ -14,7 +14,7 @@ class TestImage(unittest.TestCase):
def test_get_img_dir(self):
"""> Validate image directory."""
result = image.get("tests/test_files")
- self.assertEqual(result.endswith(".jpg"), True)
+ self.assertEqual(result.endswith((".jpg", ".png")), True)
def test_get_img_fail(self):
"""> Validate image file. (fail)"""