Skip to content

Commit 05199c6

Browse files
committed
Add return value
1 parent 2f4f948 commit 05199c6

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

appium/webdriver/extensions/power.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def set_power_capacity(self, percent):
2828
self.driver.set_power_capacity(50)
2929
"""
3030
self.execute(Command.SET_POWER_CAPACITY, {'percent': percent})
31+
return self
3132

3233
def set_power_ac(self, ac_state):
3334
"""Emulate power state change on the connected emulator.
@@ -40,6 +41,7 @@ def set_power_ac(self, ac_state):
4041
self.driver.set_power_ac('on')
4142
"""
4243
self.execute(Command.SET_POWER_AC, {'state': ac_state})
44+
return self
4345

4446
def _addCommands(self):
4547
self.command_executor._commands[Command.SET_POWER_CAPACITY] = \

appium/webdriver/extensions/sms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def send_sms(self, phone_number, message):
2929
self.driver.send_sms('555-123-4567', 'Hey lol')
3030
"""
3131
self.execute(Command.SEND_SMS, {'phoneNumber': phone_number, 'message': message})
32+
return self
3233

3334
def _addCommands(self):
3435
self.command_executor._commands[Command.SEND_SMS] = \

test/unit/webdriver/device/power_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
import httpretty
2222

23+
from appium.webdriver.webdriver import WebDriver
24+
2325

2426
class TestWebDriverPower(object):
2527

@@ -30,7 +32,7 @@ def test_set_power_capacity(self):
3032
httpretty.POST,
3133
appium_command('/session/1234567890/appium/device/power_capacity'),
3234
)
33-
assert driver.set_power_capacity(50) is None
35+
assert isinstance(driver.set_power_capacity(50), WebDriver) is True
3436

3537
d = get_httpretty_request_body(httpretty.last_request())
3638
assert d['percent'] == 50
@@ -42,7 +44,7 @@ def test_set_power_ac(self):
4244
httpretty.POST,
4345
appium_command('/session/1234567890/appium/device/power_ac'),
4446
)
45-
assert driver.set_power_ac('on') is None
47+
assert isinstance(driver.set_power_ac('on'), WebDriver) is True
4648

4749
d = get_httpretty_request_body(httpretty.last_request())
4850
assert d['state'] == 'on'

test/unit/webdriver/device/sms_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
import httpretty
2222

23+
from appium.webdriver.webdriver import WebDriver
24+
2325

2426
class TestWebDriverSms(object):
2527

@@ -30,7 +32,7 @@ def test_send_sms(self):
3032
httpretty.POST,
3133
appium_command('/session/1234567890/appium/device/send_sms'),
3234
)
33-
assert driver.send_sms('555-123-4567', 'Hey lol') is None
35+
assert isinstance(driver.send_sms('555-123-4567', 'Hey lol'), WebDriver) is True
3436

3537
d = get_httpretty_request_body(httpretty.last_request())
3638
assert d['phoneNumber'] == '555-123-4567'

0 commit comments

Comments
 (0)