mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-04-23 19:08:25 +02:00
general: Fixes.
This commit is contained in:
parent
d8d0297d89
commit
c8dd8f4d03
@ -4,11 +4,11 @@ Created by Dylan Araps.
|
|||||||
"""
|
"""
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
from pywal import export
|
|
||||||
from pywal import image
|
from pywal import image
|
||||||
from pywal import magic
|
from pywal import magic
|
||||||
from pywal import reload
|
from pywal import reload
|
||||||
from pywal import sequences
|
from pywal import sequences
|
||||||
|
from pywal import template
|
||||||
from pywal import wallpaper
|
from pywal import wallpaper
|
||||||
|
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ def reload_env(cache_dir=CACHE_DIR):
|
|||||||
|
|
||||||
def export_all_templates(colors, output_dir=CACHE_DIR, template_dir=None):
|
def export_all_templates(colors, output_dir=CACHE_DIR, template_dir=None):
|
||||||
"""Export all templates."""
|
"""Export all templates."""
|
||||||
export.export_all_templates(colors, output_dir, template_dir)
|
template.export_all_templates(colors, output_dir, template_dir)
|
||||||
|
|
||||||
|
|
||||||
def set_wallpaper(img):
|
def set_wallpaper(img):
|
||||||
|
1
tests/test_files/test2.jpg
Symbolic link
1
tests/test_files/test2.jpg
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
test.jpg
|
@ -14,7 +14,7 @@ class TestImage(unittest.TestCase):
|
|||||||
def test_get_img_dir(self):
|
def test_get_img_dir(self):
|
||||||
"""> Validate image directory."""
|
"""> Validate image directory."""
|
||||||
result = wal.get_image("tests/test_files")
|
result = wal.get_image("tests/test_files")
|
||||||
self.assertEqual(result, "tests/test_files/test.jpg")
|
self.assertEqual(result, "tests/test_files/test2.jpg")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -10,7 +10,7 @@ class TestGenColors(unittest.TestCase):
|
|||||||
def test_gen_colors(self):
|
def test_gen_colors(self):
|
||||||
"""> Generate a colorscheme."""
|
"""> Generate a colorscheme."""
|
||||||
result = wal.create_palette("tests/test_files/test.jpg")
|
result = wal.create_palette("tests/test_files/test.jpg")
|
||||||
self.assertEqual(result[0], "#0F191A")
|
self.assertEqual(result["colors"]["color0"], "#0F191A")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import unittest
|
import unittest
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
from pywal import export
|
from pywal import template
|
||||||
from pywal import util
|
from pywal import util
|
||||||
|
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ class TestExportColors(unittest.TestCase):
|
|||||||
|
|
||||||
output_dir = pathlib.Path("/tmp")
|
output_dir = pathlib.Path("/tmp")
|
||||||
template_dir = pathlib.Path("tests/test_files/templates")
|
template_dir = pathlib.Path("tests/test_files/templates")
|
||||||
export.export_all_templates(COLORS, template_dir, output_dir)
|
template.export_all_templates(COLORS, output_dir, template_dir)
|
||||||
|
|
||||||
result = pathlib.Path("/tmp/test_template").is_file()
|
result = pathlib.Path("/tmp/test_template").is_file()
|
||||||
self.assertTrue(result)
|
self.assertTrue(result)
|
Loading…
Reference in New Issue
Block a user