summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-07-23 11:50:46 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-07-23 11:50:46 +1000
commitd8376eecc90b659f7b087ddd2ec0f29200ae6141 (patch)
tree11717deacbdd3c9b6302d015b288080a62271250
parent7e5723d7c1104f984642059e7e514a58924afd49 (diff)
tests: Update tests.
-rwxr-xr-xtests/test_export.py (renamed from tests/test_template.py)10
-rw-r--r--tests/test_image.py2
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_template.py b/tests/test_export.py
index 14b1124..ebf5740 100755
--- a/tests/test_template.py
+++ b/tests/test_export.py
@@ -2,7 +2,7 @@
import unittest
import pathlib
-from pywal import template
+from pywal import export
from pywal import util
@@ -19,7 +19,7 @@ class TestExportColors(unittest.TestCase):
def test_all_templates(self):
"""> Test substitutions in template file."""
- template.export_all(COLORS, OUTPUT_DIR)
+ export.every(COLORS, OUTPUT_DIR)
result = pathlib.Path("/tmp/wal/colors.sh").is_file()
self.assertTrue(result)
@@ -30,12 +30,12 @@ class TestExportColors(unittest.TestCase):
def test_css_template(self):
"""> Test substitutions in template file (css)."""
- template.export(COLORS, "colors.css", OUTPUT_DIR)
+ export.color(COLORS, "css", OUTPUT_DIR / "test.css")
- result = pathlib.Path("/tmp/wal/colors.css").is_file()
+ result = pathlib.Path("/tmp/wal/test.css").is_file()
self.assertTrue(result)
- content = pathlib.Path("/tmp/wal/colors.css").read_text()
+ content = pathlib.Path("/tmp/wal/test.css").read_text()
content = content.split("\n")[6]
self.assertEqual(content, " --background: #1F211E;")
diff --git a/tests/test_image.py b/tests/test_image.py
index da557a7..e0b7902 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, "tests/test_files/test2.jpg")
+ self.assertEqual(result.endswith(".jpg"), True)
if __name__ == "__main__":