Skip to content

Commit bdb1255

Browse files
author
Zoia
committed
Reduce if statements number #6
1 parent 5f7755a commit bdb1255

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

JDI/web/selenium/elements/base/element.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@ class Element(BaseElement):
1010

1111
def __init__(self, by_locator=None, web_element=None):
1212
self.parent = None
13-
if by_locator is not None:
14-
super(Element, self).__init__(by_locator=by_locator)
15-
elif web_element is not None:
16-
super(Element, self).__init__()
13+
super(Element, self).__init__(by_locator=by_locator)
14+
if web_element is not None:
1715
self.avatar.set_web_element(web_element)
18-
else:
19-
super(Element, self).__init__()
2016

2117
def get_element(self):
2218
return self.avatar.get_element()

JDI/web/selenium/elements/complex/selector.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66

77
class Selector(BaseSelector):
88
def __init__(self, by_option_locator_template=None, by_option_locator_all=None):
9-
if by_option_locator_all is None:
10-
super(Selector, self).__init__(by_option_locator_template=by_option_locator_template)
11-
else:
12-
super(Selector, self).__init__(by_option_locator_template=by_option_locator_template,
13-
by_option_locator_all=by_option_locator_all)
9+
super(Selector, self).__init__(by_option_locator_template=by_option_locator_template,
10+
by_option_locator_all=by_option_locator_all)
1411

1512
def is_selected_action(self, el):
1613
if isinstance(el, str):

0 commit comments

Comments
 (0)