From de47c1beaaa77ee6f50235daba735ccc98ad608c Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Jul 2017 22:26:49 +1000 Subject: api: Remove wal.py --- tests/test_colors.py | 17 +++++++++++++++++ tests/test_image.py | 10 +++------- tests/test_magic.py | 17 ----------------- tests/test_template.py | 4 ++-- 4 files changed, 22 insertions(+), 26 deletions(-) create mode 100755 tests/test_colors.py delete mode 100755 tests/test_magic.py (limited to 'tests') diff --git a/tests/test_colors.py b/tests/test_colors.py new file mode 100755 index 0000000..e83c54d --- /dev/null +++ b/tests/test_colors.py @@ -0,0 +1,17 @@ +"""Test imagemagick functions.""" +import unittest + +from pywal import colors + + +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") + self.assertEqual(result["colors"]["color0"], "#0F191A") + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_image.py b/tests/test_image.py index 95a357e..da557a7 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -1,23 +1,19 @@ """Test image functions.""" -import pathlib import unittest -from pywal import wal - - -CACHE_DIR = pathlib.Path("/tmp/wal") +from pywal import image class TestImage(unittest.TestCase): """Test image functions.""" def test_get_img(self): """> Validate image file.""" - result = wal.get_image("tests/test_files/test.jpg", CACHE_DIR) + result = image.get("tests/test_files/test.jpg") self.assertEqual(result, "tests/test_files/test.jpg") def test_get_img_dir(self): """> Validate image directory.""" - result = wal.get_image("tests/test_files", CACHE_DIR) + result = image.get("tests/test_files") self.assertEqual(result, "tests/test_files/test2.jpg") diff --git a/tests/test_magic.py b/tests/test_magic.py deleted file mode 100755 index a3434df..0000000 --- a/tests/test_magic.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Test imagemagick functions.""" -import unittest - -from pywal import wal - - -class TestGenColors(unittest.TestCase): - """Test the gen_colors functions.""" - - def test_gen_colors(self): - """> Generate a colorscheme.""" - result = wal.create_palette("tests/test_files/test.jpg") - self.assertEqual(result["colors"]["color0"], "#0F191A") - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_template.py b/tests/test_template.py index 992c9c0..ef71b8b 100755 --- a/tests/test_template.py +++ b/tests/test_template.py @@ -2,7 +2,7 @@ import unittest import pathlib -from pywal import wal +from pywal import template from pywal import util @@ -21,7 +21,7 @@ class TestExportColors(unittest.TestCase): output_dir = pathlib.Path("/tmp") template_dir = pathlib.Path("tests/test_files/templates") - wal.export_all_templates(COLORS, output_dir, template_dir) + template.export_all(COLORS, output_dir, template_dir) result = pathlib.Path("/tmp/test_template").is_file() self.assertTrue(result) -- cgit v1.2.3