• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ssokolow / quicktile / 17528225877

07 Sep 2025 12:02PM UTC coverage: 80.265% (+15.8%) from 64.422%
17528225877

Pull #147

github

web-flow
Merge 87d72006a into b0c6e46bf
Pull Request #147: Merge beginnings of a functional test suite into PyTest runs

479 of 621 branches covered (77.13%)

Branch coverage included in aggregate %.

31 of 33 new or added lines in 4 files covered. (93.94%)

1396 of 1715 relevant lines covered (81.4%)

0.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.74
/tests/test_functional.py
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
"""Beginnings of a functional test harness for QuickTile
1✔
4

5
.. todo:: Don't forget to test unusual configurations such as:
6

7
    1. ``monitor-*`` commands with only one monitor
8
    2. ``workspace-*`` commands with only one workspace
9
    3. Having screens 1, 2, and 4 but not 0 or 3 (eg. hotplug aftermath)
10
    4. Having no windows on the desktop
11
    5. Having no window manager (with and without windows)
12
    6. Various Xinerama layouts
13
    7. Test with Xinerama disabled
14
"""
15

16
from __future__ import (absolute_import, division, print_function,
1✔
17
                        with_statement, unicode_literals)
18

19
__author__ = "Stephan Sokolow (deitarion/SSokolow)"
1✔
20
__license__ = "MIT"
1✔
21

22
#: The sequence of commands to call QuickTile with
23
TEST_SCRIPT = [x.split('#')[0].strip() for x in """
1✔
24
monitor-next-all
25
monitor-prev-all
26
monitor-switch-all
27
monitor-prev-all
28

29
monitor-next
30
monitor-prev
31
monitor-switch
32
monitor-prev
33

34
bottom
35
bottom-left
36
bottom-right
37
left
38
center
39
right
40
top
41
top-left
42
top-right
43

44
move-to-bottom
45
move-to-bottom-left
46
move-to-bottom-right
47
move-to-center
48
move-to-left
49
move-to-right
50
move-to-top
51
move-to-top-left
52
move-to-top-right
53

54
bordered
55
bordered
56

57
always-above
58
always-above
59
always-below
60
always-below
61
horizontal-maximize
62
horizontal-maximize
63
vertical-maximize
64
vertical-maximize
65
shade
66
shade
67
fullscreen
68
fullscreen
69
all-desktops
70
all-desktops
71

72
trigger-move
73
trigger-resize
74

75
workspace-send-down
76
workspace-go-down
77

78
workspace-send-up
79
workspace-go-up
80

81
workspace-send-left
82
workspace-go-left
83

84
workspace-send-right
85
workspace-go-right
86

87
workspace-send-next
88
workspace-go-next
89

90
workspace-send-prev
91
workspace-go-prev
92

93
show-desktop
94
show-desktop
95

96
maximize
97
maximize
98

99
minimize
100
""".split() if x.split('#')[0].strip()]
101

102
import logging, subprocess, time  # nosec
1✔
103

104
import pytest
1✔
105
from quicktile.wm import WindowManager, Xatom
1✔
106

107
from tests.functional_harness.env_general import background_proc
1✔
108

109
log = logging.getLogger(__name__)
1✔
110

111

112
@pytest.fixture(scope="module")
1✔
113
def openbox_session():
1✔
114
    log.info("Starting test copy of Openbox...")
1✔
115
    with background_proc(['openbox', '--startup', 'zenity --info']):
1✔
116
        wm = WindowManager()
1✔
117

118
        start = time.time()
1✔
119
        while wm.get_property(wm.x_root.id, '_NET_SUPPORTING_WM_CHECK',
1✔
120
                Xatom.WINDOW) is None:
121
            if time.time() - start > 5:
1✔
NEW
122
                raise Exception("Timed out waiting for window manager")
×
123
            else:
124
                time.sleep(0.1)
1✔
125

126
        yield
1✔
127

128

129
@ pytest.mark.parametrize("command", TEST_SCRIPT)
1✔
130
def test_functional(openbox_session, command):
1✔
131
    """Run the old bank of 'commands don't crash' tests"""
132
    log.info("Testing command: %s", command)
1✔
133
    subprocess.check_call(['./quicktile.sh', '--no-excepthook',
1✔
134
        command], env=openbox_session)  # nosec
135

136

137
def test_quicktile_sh_reports_failure(openbox_session):
1✔
138
    """Verify that quicktile.sh passes the return code through"""
139
    assert subprocess.call(['./quicktile.sh', '--i-am-an-invalid-option']) == 2
1✔
140

141
# vim: set sw=4 sts=4 expandtab :
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc