bumblebee-status/tests/test_output.py
Tobias Witek e931bb93c6 [core] Rework core implementation
Experimental re-implementation of core functionality with the aim:
- Depend only on the Python Standard Library for core
- If modules are missing elsewhere, *never* throw
- Unit test *everything*
- Cleaner and more minimal implementation
- Better integration points for existing implementations (charts,
  braille, etc.)
- Full backwards-compatibility with existing module system (except where
  modules can be vastly simplified)
2020-01-19 13:29:34 +01:00

27 lines
803 B
Python

import unittest
import json
import core.output
class i3(unittest.TestCase):
def setUp(self):
self.i3 = core.output.i3()
def tearDown(self):
pass
def test_start(self):
data = json.loads(self.i3.start())
self.assertEquals(1, data['version'], 'i3bar protocol version 1 expected')
self.assertTrue(data['click_events'], 'click events should be enabled')
def test_begin_status_line(self):
self.assertEquals('[', self.i3.begin_status_line(), 'each line must be a JSON array')
def test_end_status_line(self):
self.assertEquals('],\n', self.i3.end_status_line(), 'each line must terminate properly')
def test_stop(self):
self.assertEquals(']\n', self.i3.stop())
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4