tests: Update tests.

This commit is contained in:
Dylan Araps 2018-01-17 09:09:34 +11:00
parent 0a71cb7b2b
commit 2601caead6
4 changed files with 9 additions and 3 deletions

View file

@ -114,6 +114,6 @@ def file(input_file):
data["wallpaper"] = "None"
if "alpha" not in data:
data["alpha"] = 100
data["alpha"] = "100"
return data

View file

@ -27,6 +27,11 @@ class TestGenColors(unittest.TestCase):
result = colors.file("tests/test_files/test_file2.json")
self.assertEqual(result["wallpaper"], "None")
def test_color_import_no_alpha(self):
"""> Read colors from a file without an alpha."""
result = colors.file("tests/test_files/test_file2.json")
self.assertEqual(result["alpha"], "100")
if __name__ == "__main__":
unittest.main()

View file

@ -1,5 +1,6 @@
{
"wallpaper": "5.png",
"alpha": "100",
"special": {
"background": "#1F211E",

View file

@ -14,7 +14,7 @@ class Testsequences(unittest.TestCase):
def test_set_special(self):
"""> Create special escape sequence."""
util.Color.alpha_num = 100
util.Color.alpha_num = "100"
result = sequences.set_special(11, COLORS["special"]["background"])
if platform.uname()[0] == "Darwin":
@ -24,7 +24,7 @@ class Testsequences(unittest.TestCase):
def test_set_special_alpha(self):
"""> Create special escape sequence with alpha."""
util.Color.alpha_num = 99
util.Color.alpha_num = "99"
result = sequences.set_special(11, COLORS["special"]["background"])
if platform.uname()[0] == "Darwin":