21
21
from appium .webdriver .mobilecommand import MobileCommand as Command
22
22
23
23
24
- class GsmCallActions ( object ) :
24
+ class GsmCallActions :
25
25
CALL = 'call'
26
26
ACCEPT = 'accept'
27
27
CANCEL = 'cancel'
28
28
HOLD = 'hold'
29
29
30
30
31
- class GsmSignalStrength ( object ) :
31
+ class GsmSignalStrength :
32
32
NONE_OR_UNKNOWN = 0
33
33
POOR = 1
34
34
MODERATE = 2
35
35
GOOD = 3
36
36
GREAT = 4
37
37
38
38
39
- class GsmVoiceState ( object ) :
39
+ class GsmVoiceState :
40
40
UNREGISTERED = 'unregistered'
41
41
HOME = 'home'
42
42
ROAMING = 'roaming'
@@ -66,8 +66,8 @@ def make_gsm_call(self, phone_number: str, action: str) -> T:
66
66
"""
67
67
constants = extract_const_attributes (GsmCallActions )
68
68
if action not in constants .values ():
69
- logger .warning ('{} is unknown. Consider using one of {} constants. (e.g. {}.CALL)' . format (
70
- action , list (constants .keys ()), GsmCallActions .__name__ ) )
69
+ logger .warning (
70
+ f' { action } is unknown. Consider using one of { list (constants .keys ())} constants. (e.g. { GsmCallActions .__name__ } .CALL)' )
71
71
self .execute (Command .MAKE_GSM_CALL , {'phoneNumber' : phone_number , 'action' : action })
72
72
return self
73
73
@@ -85,8 +85,8 @@ def set_gsm_signal(self, strength: int) -> T:
85
85
"""
86
86
constants = extract_const_attributes (GsmSignalStrength )
87
87
if strength not in constants .values ():
88
- logger .warning ('{} is out of range. Consider using one of {} constants. (e.g. {}.GOOD)' . format (
89
- strength , list (constants .keys ()), GsmSignalStrength .__name__ ) )
88
+ logger .warning (
89
+ f' { strength } is out of range. Consider using one of { list (constants .keys ())} constants. (e.g. { GsmSignalStrength .__name__ } .GOOD)' )
90
90
self .execute (Command .SET_GSM_SIGNAL , {'signalStrength' : strength , 'signalStrengh' : strength })
91
91
return self
92
92
@@ -104,8 +104,8 @@ def set_gsm_voice(self, state: str) -> T:
104
104
"""
105
105
constants = extract_const_attributes (GsmVoiceState )
106
106
if state not in constants .values ():
107
- logger .warning ('{} is unknown. Consider using one of {} constants. (e.g. {}.HOME)' . format (
108
- state , list (constants .keys ()), GsmVoiceState .__name__ ) )
107
+ logger .warning (
108
+ f' { state } is unknown. Consider using one of { list (constants .keys ())} constants. (e.g. { GsmVoiceState .__name__ } .HOME)' )
109
109
self .execute (Command .SET_GSM_VOICE , {'state' : state })
110
110
return self
111
111
0 commit comments