diff --git a/pywal/colors.py b/pywal/colors.py index 1fa4b0e..f140887 100644 --- a/pywal/colors.py +++ b/pywal/colors.py @@ -114,6 +114,6 @@ def file(input_file): data["wallpaper"] = "None" if "alpha" not in data: - data["alpha"] = 100 + data["alpha"] = "100" return data diff --git a/tests/test_colors.py b/tests/test_colors.py index 5efafa0..a3b939c 100755 --- a/tests/test_colors.py +++ b/tests/test_colors.py @@ -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() diff --git a/tests/test_files/test_file.json b/tests/test_files/test_file.json index c555eda..fcb5f40 100644 --- a/tests/test_files/test_file.json +++ b/tests/test_files/test_file.json @@ -1,5 +1,6 @@ { "wallpaper": "5.png", + "alpha": "100", "special": { "background": "#1F211E", diff --git a/tests/test_sequences.py b/tests/test_sequences.py index 8e4dc74..f5680eb 100755 --- a/tests/test_sequences.py +++ b/tests/test_sequences.py @@ -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":