tests: Test sending escape sequences
"""Test sequence functions."""
import unittest
+import unittest.mock
+import io
from pywal import sequences
from pywal import util
@@ -22,6 +24,13 @@ class Testsequences(unittest.TestCase):
result = sequences.set_color(11, COLORS["colors"]["color0"])
self.assertEqual(result, "\033]4;11;#1F211E\007")
+ def test_send_srquences(self):
+ """> Send sequences to all open terminals."""
+ with unittest.mock.patch('sys.stdout', new=io.StringIO()) as fake_out:
+ sequences.send(COLORS, False)
+ self.assertEqual(fake_out.getvalue().strip(),
+ "colors: Set terminal colors")
+
if __name__ == "__main__":
unittest.main()
