summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Bienkowski <pb@opatut.de>2017-06-29 16:47:13 +0200
committerPaul Bienkowski <pb@opatut.de>2017-06-29 16:47:13 +0200
commit9de88ad3b84d6211df5e8174db5c8b71a3bd3811 (patch)
tree81d57f74322b1084fe8a79512219d07157219d42 /tests
parentfce5036554a66c420d985f276e417b5ca86a4b04 (diff)
template: refactor to allow {color1.rgb} notation and remove putty exception
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_export_colors.py9
-rw-r--r--tests/test_files/templates/test_template3
-rw-r--r--tests/test_files/test_template2
3 files changed, 8 insertions, 6 deletions
diff --git a/tests/test_export_colors.py b/tests/test_export_colors.py
index 90af273..b458aa5 100755
--- a/tests/test_export_colors.py
+++ b/tests/test_export_colors.py
@@ -19,14 +19,15 @@ class TestExportColors(unittest.TestCase):
# values simpler.
COLORS["colors"].update(COLORS["special"])
- # Dirs to use.
- tmp_dir = pathlib.Path("/tmp")
- test_template = pathlib.Path("tests/test_files/test_template")
- export_colors.template(COLORS["colors"], test_template, tmp_dir)
+ output_dir = pathlib.Path("/tmp")
+ export_colors.export_all_templates(COLORS, pathlib.Path("tests/test_files/templates"), output_dir)
result = pathlib.Path("/tmp/test_template").is_file()
self.assertTrue(result)
+ content = pathlib.Path("/tmp/test_template").read_text()
+ self.assertEqual(content, '\n'.join(["test1 #3A5130", "test2 #3A5130", "test3 58,81,48", ""]))
+
if __name__ == "__main__":
unittest.main()
diff --git a/tests/test_files/templates/test_template b/tests/test_files/templates/test_template
new file mode 100644
index 0000000..af40ce7
--- /dev/null
+++ b/tests/test_files/templates/test_template
@@ -0,0 +1,3 @@
+test1 {color0}
+test2 {background}
+test3 {background.rgb}
diff --git a/tests/test_files/test_template b/tests/test_files/test_template
deleted file mode 100644
index 167e17b..0000000
--- a/tests/test_files/test_template
+++ /dev/null
@@ -1,2 +0,0 @@
-test {color0}
-test {background}