Skip to content

Commit 4c2c1df

Browse files
author
Mickaël Schoentgen
committed
Add test for screen shot part
1 parent 61b5c6b commit 4c2c1df

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

mss/darwin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ class CGRect(Structure):
4949

5050

5151
class MSS(MSSBase):
52-
''' Mutliple ScreenShots implementation for MacOS X.
52+
''' Mutliple ScreenShots implementation for macOS.
5353
It uses intensively the Quartz.
5454
'''
5555

5656
max_displays = 32 # Could be augmented, if needed ...
5757

5858
def __init__(self):
59-
''' MacOS X initialisations. '''
59+
''' macOS initialisations. '''
6060

6161
coregraphics = find_library('CoreGraphics')
6262
if not coregraphics:

tests/test_attributes.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,8 @@
22
# coding: utf-8
33

44

5-
def test_attribute_image(sct):
5+
def test_attributes(sct):
66
assert sct.image is None
7-
8-
9-
def test_attribute_monitors(sct):
107
assert sct.monitors == []
11-
12-
13-
def test_attribute_width(sct):
148
assert sct.width == 0
15-
16-
17-
def test_attribute_height(sct):
189
assert sct.height == 0

tests/test_get_pixels.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ def test_get_pixels(sct):
77
pixels = sct.get_pixels(mon1)
88
assert pixels is sct.image
99
assert isinstance(sct.image, bytes)
10+
11+
12+
def test_get_pixels_part_of_screen(sct):
13+
mon = {'top': 160, 'left': 160, 'width': 222, 'height': 42}
14+
pixels = sct.get_pixels(mon)
15+
assert pixels is sct.image
16+
assert isinstance(sct.image, bytes)
17+
assert sct.width == 222
18+
assert sct.height == 42

0 commit comments

Comments
 (0)