mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-29 03:13:47 +01:00
tests: Added set_colors tests.
This commit is contained in:
parent
081bb9066b
commit
790ab71c50
2
setup.py
2
setup.py
@ -35,6 +35,6 @@ setup(
|
||||
entry_points={
|
||||
"console_scripts": ["wal=pywal.__main__:main"]
|
||||
},
|
||||
requires_python=">=3.6",
|
||||
python_requires=">=3.6",
|
||||
test_suite="tests",
|
||||
)
|
||||
|
@ -1,10 +1,15 @@
|
||||
"""Test util functions."""
|
||||
import unittest
|
||||
import pathlib
|
||||
|
||||
from pywal import export_colors
|
||||
from pywal import util
|
||||
|
||||
|
||||
# Import colors.
|
||||
COLORS = util.read_file("tests/test_file")
|
||||
|
||||
|
||||
class TestExportColors(unittest.TestCase):
|
||||
"""Test the export_colors functions."""
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
"""Test format functions."""
|
||||
import unittest
|
||||
|
||||
from pywal import format_color
|
||||
from pywal import util
|
||||
|
||||
@ -8,7 +9,7 @@ from pywal import util
|
||||
COLORS = util.read_file("tests/test_file")
|
||||
|
||||
|
||||
class TestExportColors(unittest.TestCase):
|
||||
class TestFormatColors(unittest.TestCase):
|
||||
"""Test the format_colors functions."""
|
||||
|
||||
def test_plain(self):
|
||||
|
32
tests/test_set_colors.py
Executable file
32
tests/test_set_colors.py
Executable file
@ -0,0 +1,32 @@
|
||||
"""Test set functions."""
|
||||
import unittest
|
||||
|
||||
from pywal import set_colors
|
||||
from pywal import util
|
||||
|
||||
|
||||
# Import colors.
|
||||
COLORS = util.read_file("tests/test_file")
|
||||
|
||||
|
||||
class TestSetColors(unittest.TestCase):
|
||||
"""Test the format_colors functions."""
|
||||
|
||||
def test_set_special(self):
|
||||
"""> Create special escape sequence."""
|
||||
result = set_colors.set_special(11, COLORS[0])
|
||||
self.assertEqual(result, "\x1b]11;#363442\x07")
|
||||
|
||||
def test_set_color(self):
|
||||
"""> Create color escape sequence."""
|
||||
result = set_colors.set_color(11, COLORS[0])
|
||||
self.assertEqual(result, "\033]4;11;#363442\007")
|
||||
|
||||
def test_set_grey(self):
|
||||
"""> Create special escape sequence."""
|
||||
result = set_colors.set_grey(COLORS)
|
||||
self.assertEqual(result, "#999999")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
@ -1,6 +1,7 @@
|
||||
"""Test util functions."""
|
||||
import unittest
|
||||
import pathlib
|
||||
|
||||
from pywal import util
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user