File: test_caps_num_lock_indicator.py

package info (click to toggle)
qtile 0.34.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,004 kB
  • sloc: python: 49,959; ansic: 4,371; xml: 324; sh: 260; makefile: 218
file content (25 lines) | stat: -rw-r--r-- 881 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from libqtile.widget import caps_num_lock_indicator


def test_cnli():
    widget = caps_num_lock_indicator.CapsNumLockIndicator()
    raw = """Keyboard Control:
  auto repeat:  on    key click percent:  0    LED mask:  00000002
  XKB indicators:
    00: Caps Lock:   off    01: Num Lock:    on     02: Scroll Lock: off
    03: Compose:     off    04: Kana:        off    05: Sleep:       off
"""
    text = widget.parse(raw)
    assert text == "Caps off Num on"


def test_cnli_caps_on():
    widget = caps_num_lock_indicator.CapsNumLockIndicator()
    raw = """Keyboard Control:
  auto repeat:  on    key click percent:  0    LED mask:  00000002
  XKB indicators:
    00: Caps Lock:   on     01: Num Lock:    on     02: Scroll Lock: off
    03: Compose:     off    04: Kana:        off    05: Sleep:       off
"""
    text = widget.parse(raw)
    assert text == "Caps on Num on"