Skip to content

Commit b701c04

Browse files
committed
Remove dependency on enum
1 parent cba39cc commit b701c04

4 files changed

Lines changed: 4 additions & 7 deletions

File tree

appium/webdriver/connectiontype.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from enum import Enum
16-
1715

1816
"""
1917
Connection types are specified here:
@@ -26,7 +24,7 @@
2624
4 (Data only) | 1 | 0 | 0
2725
6 (All network on) | 1 | 1 | 0
2826
"""
29-
class ConnectionType(Enum):
27+
class ConnectionType(object):
3028
NO_CONNECTION = 0
3129
AIRPLANE_MODE = 1
3230
WIFI_ONLY = 2

appium/webdriver/webdriver.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from selenium import webdriver
1616

17-
from .connectiontype import ConnectionType
1817
from .mobilecommand import MobileCommand as Command
1918
from .errorhandler import MobileErrorHandler
2019
from .switch_to import MobileSwitchTo
@@ -638,7 +637,7 @@ def set_network_connection(self, connectionType):
638637
"""
639638
data = {
640639
'parameters': {
641-
'type': connectionType.value
640+
'type': connectionType
642641
}
643642
}
644643
return self.execute(Command.SET_NETWORK_CONNECTION, data)['value']

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@
5050
'Topic :: Software Development :: Quality Assurance',
5151
'Topic :: Software Development :: Testing'
5252
],
53-
install_requires=['selenium>=2.41.0', 'enum34']
53+
install_requires=['selenium>=2.47.0']
5454
)

test/functional/android/network_connection_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_get_network_connection(self):
4141
def test_set_network_connection(self):
4242
nc = self.driver.set_network_connection(ConnectionType.DATA_ONLY)
4343
self.assertIsInstance(nc, int)
44-
self.assertEqual(nc, ConnectionType.DATA_ONLY.value)
44+
self.assertEqual(nc, ConnectionType.DATA_ONLY)
4545

4646

4747
if __name__ == "__main__":

0 commit comments

Comments
 (0)