mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-05-18 23:30:49 +02:00
tests: Test sending escape sequences
This commit is contained in:
parent
fae05ee0d2
commit
3f10cc888d
@ -1,5 +1,7 @@
|
|||||||
"""Test sequence functions."""
|
"""Test sequence functions."""
|
||||||
import unittest
|
import unittest
|
||||||
|
import unittest.mock
|
||||||
|
import io
|
||||||
|
|
||||||
from pywal import sequences
|
from pywal import sequences
|
||||||
from pywal import util
|
from pywal import util
|
||||||
@ -22,6 +24,13 @@ class Testsequences(unittest.TestCase):
|
|||||||
result = sequences.set_color(11, COLORS["colors"]["color0"])
|
result = sequences.set_color(11, COLORS["colors"]["color0"])
|
||||||
self.assertEqual(result, "\033]4;11;#1F211E\007")
|
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__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
Reference in New Issue
Block a user