summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-07-09 23:57:53 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-07-09 23:57:53 +1000
commitb5806287d303fe0ee36e5930c24f488b08c3c441 (patch)
tree4c995ce71a3348bb96737a3a5849899df436337e
parent1d63b05e408d9f63e0147cdd9b1988ef63100eb9 (diff)
export: Add wallpaper to export files,
-rwxr-xr-xtests/test_export.py6
-rw-r--r--tests/test_files/test_file.json41
-rwxr-xr-xtests/test_sequences.py4
-rwxr-xr-xtests/test_util.py11
4 files changed, 34 insertions, 28 deletions
diff --git a/tests/test_export.py b/tests/test_export.py
index 7204f48..167d3ed 100755
--- a/tests/test_export.py
+++ b/tests/test_export.py
@@ -27,9 +27,9 @@ class TestExportColors(unittest.TestCase):
self.assertTrue(result)
content = pathlib.Path("/tmp/test_template").read_text()
- self.assertEqual(content, '\n'.join(["test1 #3A5130",
- "test2 #3A5130",
- "test3 58,81,48", ""]))
+ self.assertEqual(content, '\n'.join(["test1 #1F211E",
+ "test2 #1F211E",
+ "test3 31,33,30", ""]))
if __name__ == "__main__":
diff --git a/tests/test_files/test_file.json b/tests/test_files/test_file.json
index b92c84e..c555eda 100644
--- a/tests/test_files/test_file.json
+++ b/tests/test_files/test_file.json
@@ -1,26 +1,27 @@
{
+ "wallpaper": "5.png",
+
"special": {
- "background":"#3A5130",
- "foreground":"#FAF9F5",
- "cursor":"#FAF9F5"
+ "background": "#1F211E",
+ "foreground": "#F5F1F4",
+ "cursor": "#F5F1F4"
},
-
"colors": {
- "color0":"#3A5130",
- "color1":"#E3A19D",
- "color2":"#E1CEAE",
- "color3":"#D6DDCC",
- "color4":"#F1D2CB",
- "color5":"#F5E9D6",
- "color6":"#F9F0E5",
- "color7":"#FAF9F5",
- "color8":"#999999",
- "color9":"#E3A19D",
- "color10":"#E1CEAE",
- "color11":"#D6DDCC",
- "color12":"#F1D2CB",
- "color13":"#F5E9D6",
- "color14":"#F9F0E5",
- "color15":"#FAF9F5"
+ "color0": "#1F211E",
+ "color1": "#4B7A85",
+ "color2": "#CC6A93",
+ "color3": "#5C9894",
+ "color4": "#A0A89B",
+ "color5": "#D1B9A9",
+ "color6": "#E3D6D8",
+ "color7": "#F5F1F4",
+ "color8": "#666666",
+ "color9": "#4B7A85",
+ "color10": "#CC6A93",
+ "color11": "#5C9894",
+ "color12": "#A0A89B",
+ "color13": "#D1B9A9",
+ "color14": "#E3D6D8",
+ "color15": "#F5F1F4"
}
}
diff --git a/tests/test_sequences.py b/tests/test_sequences.py
index f4cbb36..44a98ce 100755
--- a/tests/test_sequences.py
+++ b/tests/test_sequences.py
@@ -15,12 +15,12 @@ class Testsequences(unittest.TestCase):
def test_set_special(self):
"""> Create special escape sequence."""
result = sequences.set_special(11, COLORS["special"]["background"])
- self.assertEqual(result, "\x1b]11;#3A5130\x07")
+ self.assertEqual(result, "\x1b]11;#1F211E\x07")
def test_set_color(self):
"""> Create color escape sequence."""
result = sequences.set_color(11, COLORS["colors"]["color0"])
- self.assertEqual(result, "\033]4;11;#3A5130\007")
+ self.assertEqual(result, "\033]4;11;#1F211E\007")
if __name__ == "__main__":
diff --git a/tests/test_util.py b/tests/test_util.py
index 9cb908a..841c242 100755
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -16,7 +16,7 @@ class TestUtil(unittest.TestCase):
"""> Get grey color based on brightness of color0"""
colors = [list(COLORS["colors"].values())]
result = util.set_grey(colors[0])
- self.assertEqual(result, "#999999")
+ self.assertEqual(result, "#666666")
def test_read_file(self):
"""> Read colors from a file."""
@@ -26,12 +26,17 @@ class TestUtil(unittest.TestCase):
def test_read_file_start(self):
"""> Read colors from a file."""
result = util.read_file_json("tests/test_files/test_file.json")
- self.assertEqual(result["colors"]["color0"], "#3A5130")
+ self.assertEqual(result["colors"]["color0"], "#1F211E")
def test_read_file_end(self):
"""> Read colors from a file."""
result = util.read_file_json("tests/test_files/test_file.json")
- self.assertEqual(result["colors"]["color15"], "#FAF9F5")
+ self.assertEqual(result["colors"]["color15"], "#F5F1F4")
+
+ def test_read_wallpaper(self):
+ """> Read wallpaper from json file."""
+ result = util.read_file_json("tests/test_files/test_file.json")
+ self.assertEqual(result["wallpaper"], "5.png")
def test_save_file(self):
"""> Save colors to a file."""