2020-01-01 21:22:31 +01:00
|
|
|
import unittest
|
2020-01-19 13:29:34 +01:00
|
|
|
import json
|
2020-01-01 21:22:31 +01:00
|
|
|
|
2020-01-19 13:29:34 +01:00
|
|
|
import core.output
|
2020-01-01 21:22:31 +01:00
|
|
|
|
2020-01-19 13:29:34 +01:00
|
|
|
class i3(unittest.TestCase):
|
2020-01-01 21:22:31 +01:00
|
|
|
def setUp(self):
|
2020-01-19 13:29:34 +01:00
|
|
|
self.i3 = core.output.i3()
|
|
|
|
|
|
|
|
def tearDown(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def test_start(self):
|
2020-02-01 21:37:38 +01:00
|
|
|
all_data = self.i3.start()
|
|
|
|
data = all_data['data']
|
2020-01-19 15:36:52 +01:00
|
|
|
self.assertEqual(1, data['version'], 'i3bar protocol version 1 expected')
|
2020-01-19 13:29:34 +01:00
|
|
|
self.assertTrue(data['click_events'], 'click events should be enabled')
|
2020-02-01 21:37:38 +01:00
|
|
|
self.assertEqual('\n[', all_data['suffix'])
|
2020-01-19 13:29:34 +01:00
|
|
|
|
|
|
|
def test_stop(self):
|
2020-02-01 21:37:38 +01:00
|
|
|
self.assertEqual('\n]', self.i3.stop()['suffix'])
|
|
|
|
|
|
|
|
# TODO: mock a "draw" call
|
2020-01-19 13:29:34 +01:00
|
|
|
|
|
|
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|