mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-05-01 06:34:25 +02:00
tests: Update tests.
This commit is contained in:
parent
0a71cb7b2b
commit
2601caead6
@ -114,6 +114,6 @@ def file(input_file):
|
|||||||
data["wallpaper"] = "None"
|
data["wallpaper"] = "None"
|
||||||
|
|
||||||
if "alpha" not in data:
|
if "alpha" not in data:
|
||||||
data["alpha"] = 100
|
data["alpha"] = "100"
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
@ -27,6 +27,11 @@ class TestGenColors(unittest.TestCase):
|
|||||||
result = colors.file("tests/test_files/test_file2.json")
|
result = colors.file("tests/test_files/test_file2.json")
|
||||||
self.assertEqual(result["wallpaper"], "None")
|
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__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"wallpaper": "5.png",
|
"wallpaper": "5.png",
|
||||||
|
"alpha": "100",
|
||||||
|
|
||||||
"special": {
|
"special": {
|
||||||
"background": "#1F211E",
|
"background": "#1F211E",
|
||||||
|
@ -14,7 +14,7 @@ class Testsequences(unittest.TestCase):
|
|||||||
|
|
||||||
def test_set_special(self):
|
def test_set_special(self):
|
||||||
"""> Create special escape sequence."""
|
"""> Create special escape sequence."""
|
||||||
util.Color.alpha_num = 100
|
util.Color.alpha_num = "100"
|
||||||
result = sequences.set_special(11, COLORS["special"]["background"])
|
result = sequences.set_special(11, COLORS["special"]["background"])
|
||||||
|
|
||||||
if platform.uname()[0] == "Darwin":
|
if platform.uname()[0] == "Darwin":
|
||||||
@ -24,7 +24,7 @@ class Testsequences(unittest.TestCase):
|
|||||||
|
|
||||||
def test_set_special_alpha(self):
|
def test_set_special_alpha(self):
|
||||||
"""> Create special escape sequence with alpha."""
|
"""> Create special escape sequence with alpha."""
|
||||||
util.Color.alpha_num = 99
|
util.Color.alpha_num = "99"
|
||||||
result = sequences.set_special(11, COLORS["special"]["background"])
|
result = sequences.set_special(11, COLORS["special"]["background"])
|
||||||
|
|
||||||
if platform.uname()[0] == "Darwin":
|
if platform.uname()[0] == "Darwin":
|
||||||
|
Loading…
Reference in New Issue
Block a user