[core/output] Add initial version of i3bar output
Add output handler for i3bar protocol and add some tests for it. Right now, it only support start and end. see #23
This commit is contained in:
parent
a2c6214baa
commit
6f52825ef0
5 changed files with 59 additions and 6 deletions
28
tests/test_i3baroutput.py
Normal file
28
tests/test_i3baroutput.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
# pylint: disable=C0103,C0111
|
||||
import json
|
||||
import unittest
|
||||
import mock
|
||||
try:
|
||||
from StringIO import StringIO
|
||||
except ImportError:
|
||||
from io import StringIO
|
||||
|
||||
from bumblebee.output import I3BarOutput
|
||||
|
||||
class TestI3BarOutput(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.output = I3BarOutput()
|
||||
self.expectedStart = json.dumps({"version": 1, "click_events": True}) + "[\n"
|
||||
self.expectedStop = "]\n"
|
||||
|
||||
@mock.patch("sys.stdout", new_callable=StringIO)
|
||||
def test_start(self, stdout):
|
||||
self.output.start()
|
||||
self.assertEquals(self.expectedStart, stdout.getvalue())
|
||||
|
||||
@mock.patch("sys.stdout", new_callable=StringIO)
|
||||
def test_stop(self, stdout):
|
||||
self.output.stop()
|
||||
self.assertEquals(self.expectedStop, stdout.getvalue())
|
||||
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
Loading…
Add table
Add a link
Reference in a new issue