Skip to content

Commit 3a6d4db

Browse files
committed
tests: more tests, Travis OK (ouf!)
1 parent d7e92dc commit 3a6d4db

File tree

6 files changed

+33
-12
lines changed

6 files changed

+33
-12
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ An ultra fast cross-platform multiple screenshots module in pure python using ct
1414
- you can `report a bug <https://github.com/BoboTiG/python-mss/issues>`_;
1515
- and there is a `complete, and beautiful, documentation <https://python-mss.readthedocs.io>`_ :)
1616
- **MSS** stands for Multiple ScreenShots;
17-
- insanely fast, did I said it?
17+
- insanely fast, did I say it?
1818

1919

2020
Installation

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ An ultra fast cross-platform multiple screenshots module in pure python using ct
1010
- get the `source code on GitHub <https://github.com/BoboTiG/python-mss>`_;
1111
- you can `report a bug <https://github.com/BoboTiG/python-mss/issues>`_;
1212
- **MSS** stands for Multiple ScreenShots;
13-
- insanely fast, did I said it?
13+
- insanely fast, did I say it?
1414

1515
+-------------------------+
1616
| Content |

tests/dummy.xorg.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,3 @@ Section "ServerLayout"
129129
InputDevice "NoMouse"
130130
InputDevice "NoKeyboard"
131131
EndSection
132-

tests/test_enum_display_monitors.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ def test_get_monitors(mss):
88
assert monitors
99

1010

11+
def test_get_monitors_force(mss):
12+
monitors = mss.enum_display_monitors(force=True)
13+
assert monitors is mss.monitors
14+
assert monitors
15+
16+
1117
def test_keys_aio(mss):
1218
all_monitors = mss.monitors[0]
1319
assert 'top' in all_monitors
@@ -25,14 +31,14 @@ def test_keys_monitor_1(mss):
2531

2632

2733
def test_dimensions(mss, is_travis):
28-
width = 1280 if is_travis else 0
29-
height = 1024 if is_travis else 0
30-
for mon in mss.monitors:
31-
assert mon['width'] >= width
32-
assert mon['height'] >= height
34+
mon = mss.monitors[1]
35+
if not is_travis:
36+
assert mon['width'] > 0
37+
assert mon['height'] > 0
3338

3439

35-
def test_get_monitors_force(mss):
36-
monitors = mss.enum_display_monitors(force=True)
37-
assert monitors is mss.monitors
38-
assert monitors
40+
def test_dimensions_travis(mss, is_travis):
41+
mon = mss.monitors[1]
42+
if is_travis:
43+
assert mon['width'] == 1920
44+
assert mon['height'] == 1440

tests/test_get_pixels.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env python
2+
# coding: utf-8
3+
4+
5+
def test_get_pixels(mss):
6+
mon1 = mss.enum_display_monitors()[1]
7+
pixels = mss.get_pixels(mon1)
8+
assert pixels is mss.image
9+
assert isinstance(mss.image, bytes)

tests/test_save.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env python
2+
# coding: utf-8
3+
4+
5+
def test_at_least_2_monitors(mss):
6+
shots = list(mss.save(mon=0))
7+
assert len(shots) >= 1

0 commit comments

Comments
 (0)