mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-06-20 09:37:42 +02:00
tests: Add new template test.
This commit is contained in:
parent
676f5325e1
commit
7566104c85
@ -8,6 +8,7 @@ from pywal import util
|
|||||||
|
|
||||||
# Import colors.
|
# Import colors.
|
||||||
COLORS = util.read_file_json("tests/test_files/test_file.json")
|
COLORS = util.read_file_json("tests/test_files/test_file.json")
|
||||||
|
COLORS["colors"].update(COLORS["special"])
|
||||||
OUTPUT_DIR = pathlib.Path("/tmp/wal")
|
OUTPUT_DIR = pathlib.Path("/tmp/wal")
|
||||||
|
|
||||||
util.create_dir("/tmp/wal")
|
util.create_dir("/tmp/wal")
|
||||||
@ -18,10 +19,6 @@ class TestExportColors(unittest.TestCase):
|
|||||||
|
|
||||||
def test_all_templates(self):
|
def test_all_templates(self):
|
||||||
"""> Test substitutions in template file."""
|
"""> Test substitutions in template file."""
|
||||||
# Merge both dicts so we can access their
|
|
||||||
# values simpler.
|
|
||||||
COLORS["colors"].update(COLORS["special"])
|
|
||||||
|
|
||||||
template.export_all(COLORS, OUTPUT_DIR)
|
template.export_all(COLORS, OUTPUT_DIR)
|
||||||
|
|
||||||
result = pathlib.Path("/tmp/colors.sh").is_file()
|
result = pathlib.Path("/tmp/colors.sh").is_file()
|
||||||
@ -33,10 +30,6 @@ class TestExportColors(unittest.TestCase):
|
|||||||
|
|
||||||
def test_css_template(self):
|
def test_css_template(self):
|
||||||
"""> Test substitutions in template file (css)."""
|
"""> Test substitutions in template file (css)."""
|
||||||
# Merge both dicts so we can access their
|
|
||||||
# values simpler.
|
|
||||||
COLORS["colors"].update(COLORS["special"])
|
|
||||||
|
|
||||||
template.export(COLORS, "colors.css", OUTPUT_DIR)
|
template.export(COLORS, "colors.css", OUTPUT_DIR)
|
||||||
|
|
||||||
result = pathlib.Path("/tmp/colors.css").is_file()
|
result = pathlib.Path("/tmp/colors.css").is_file()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user