Skip to content
This repository was archived by the owner on Jan 28, 2022. It is now read-only.

Commit ff6a670

Browse files
VenkateshPSKazuCocoa
authored andcommitted
Add unit tests for isLocked Library (appium#288)
* Add unit tests for isLocked Lib * moved isLocked library tests in lock.py
1 parent 5a633a9 commit ff6a670

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

test/unit/webdriver/device/lock_test.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,24 @@ def test_lock_no_args(self):
4444
d = json.loads(httpretty.last_request().body.decode('utf-8'))
4545
assert len(d.keys()) == 1
4646
assert d['sessionId'] == '1234567890'
47+
48+
@httpretty.activate
49+
def test_islocked_false(self):
50+
driver = android_w3c_driver()
51+
httpretty.register_uri(
52+
httpretty.POST,
53+
appium_command('/session/1234567890/appium/device/is_locked'),
54+
body='{"value": false}'
55+
)
56+
assert driver.is_locked() is False
57+
58+
@httpretty.activate
59+
def test_islocked_true(self):
60+
driver = android_w3c_driver()
61+
httpretty.register_uri(
62+
httpretty.POST,
63+
appium_command('/session/1234567890/appium/device/is_locked'),
64+
body='{"value": true}'
65+
)
66+
67+
assert driver.is_locked() is True

0 commit comments

Comments
 (0)