Skip to content

Commit

Permalink
removed un-used imports
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepsuryaprasad committed Jul 2, 2023
1 parent ba6afdd commit 719e23a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions appium/options/ios/xcuitest/other/other_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,16 @@ class LaunchWithIdbOption(SupportsCapabilities):
class CommandTimeoutsOption(SupportsCapabilities):
COMMAND_TIMEOUTS = 'commandTimeouts'

def transform_timeout_get(self, value):
@staticmethod
def transform_timeout_get(value):
if value is None:
return None
if isinstance(value, dict):
return {k: timedelta(milliseconds=v) for k, v in value.items()}
return timedelta(milliseconds=int(value))

def transform_timeout_set(self, value):
@staticmethod
def transform_timeout_set(value):
if isinstance(value, dict):
return {k: int(v.total_seconds() * 1000) for k, v in value.items()}
elif isinstance(value, timedelta):
Expand Down
6 changes: 4 additions & 2 deletions appium/options/ios/xcuitest/simulator/simulator_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,12 @@ class KeychainsExcludePatternsOption(SupportsCapabilities):
class PermissionsOption(SupportsCapabilities):
PERMISSIONS = 'permissions'

def transform_get(self, value):
@staticmethod
def transform_get(value):
return None if value is None else json.loads(value)

def transform_set(self, value):
@staticmethod
def transform_set(value):
return json.dumps(value, ensure_ascii=False)

permissions = OptionsDescriptor(PERMISSIONS, transform_get, transform_set)
Expand Down
2 changes: 1 addition & 1 deletion appium/options/transformers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import timedelta
from typing import Any, Optional, Union
from typing import Optional, Union


class DurationTransformer:
Expand Down

0 comments on commit 719e23a

Please sign in to comment.