diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2017-07-23 21:55:09 +1000 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2017-07-23 21:55:09 +1000 |
| commit | 3f10cc888d0baf2288f5b6d8f1d3cc8e80ec2dea (patch) | |
| tree | e3b7ae4d174efe2d6a98f9da0718e86388cbbff4 /tests | |
| parent | fae05ee0d2d5fc16460109b8ce2770d6061b9de9 (diff) | |
tests: Test sending escape sequences
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/test_sequences.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_sequences.py b/tests/test_sequences.py index a1ea10c..a5c9d07 100755 --- a/tests/test_sequences.py +++ b/tests/test_sequences.py @@ -1,5 +1,7 @@ """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() |
