Fix PEP-8 issues.

This commit is contained in:
Dave Page 2019-03-21 12:58:52 +00:00
parent 33693734fc
commit b2b5629a01
5 changed files with 21 additions and 25 deletions

View File

@ -83,9 +83,6 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
status = self.page.find_by_css_selector(
".pg-bg-status-text").text
print("Debug: .pg-bg-status-text %s"%status)
#.pg-bg-status-text
self.assertEquals(status, "Successfully completed.")
self.page.find_by_css_selector(

View File

@ -176,11 +176,11 @@ class QueryToolAutoCompleteFeatureTest(BaseFeatureTest):
Keys.CONTROL).send_keys(Keys.SPACE).key_up(Keys.CONTROL).perform()
# if IntelliSense is present then verify this
if self.page.check_if_element_exist_by_xpath\
("//ul[@class='CodeMirror-hints default']", 2):
if self.page.check_if_element_exist_by_xpath(
"//ul[@class='CodeMirror-hints default']", 2):
self.page.find_by_xpath(
"//ul[contains(@class, 'CodeMirror-hints') and "
"contains(., '" + expected_string + "')]")
"//ul[contains(@class, 'CodeMirror-hints') and "
"contains(., '" + expected_string + "')]")
else:
# if no IntelliSense is present it means there is only one option
# so check if required string is present in codeMirror
@ -188,6 +188,6 @@ class QueryToolAutoCompleteFeatureTest(BaseFeatureTest):
"//pre[@class=' CodeMirror-line ']/span")
code_mirror_text = code_mirror.text
if not expected_string in code_mirror_text:
if expected_string not in code_mirror_text:
raise Exception("Required String %s is not "
"present"%expected_string)
"present" % expected_string)

View File

@ -93,14 +93,14 @@ class QueryToolJourneyTest(BaseFeatureTest):
"does not exist", failed_history_detail_pane.text
)
self.page.wait_for_element(lambda driver: driver
.find_element_by_css_selector
("#query_list> .query-group>ul>li"))
.find_element_by_css_selector(
"#query_list> .query-group>ul>li"))
# get the query history rows and click the previous query row which
# was executed and verify it
history_rows = self.driver.find_elements_by_css_selector(
"#query_list> .query-group>ul>li")
print("the number of history_rows are 10 %s"%len(history_rows))
print("the number of history_rows are 10 %s" % len(history_rows))
history_rows[1].click()
selected_history_entry = self.page.find_by_css_selector(

View File

@ -183,7 +183,7 @@ SELECT generate_series(1, {}) as id1, 'dummy' as id2""".format(
# wait for header of the table to be visible
wait.until(EC.visibility_of_element_located(
(By.XPATH,'//div[@class="slick-header-columns"]')))
(By.XPATH, '//div[@class="slick-header-columns"]')))
wait.until(EC.presence_of_element_located(
(By.XPATH,
@ -209,7 +209,8 @@ SELECT generate_series(1, {}) as id1, 'dummy' as id2""".format(
# wait for header of the table to be visible
wait.until(EC.visibility_of_element_located(
(By.XPATH,'//div[@class="slick-header-columns"]')))
(By.XPATH, '//div[@class="slick-header-columns"]')))
# wait for first row to contain value
wait.until(EC.presence_of_element_located(
(By.XPATH,
@ -234,7 +235,7 @@ SELECT generate_series(1, {}) as id1, 'dummy' as id2""".format(
# wait for header of the table to be visible
wait.until(EC.visibility_of_element_located(
(By.XPATH,'//div[@class="slick-header-columns"]')))
(By.XPATH, '//div[@class="slick-header-columns"]')))
wait.until(EC.presence_of_element_located(
(By.XPATH,
@ -426,9 +427,7 @@ SELECT relname FROM pg_class
self.page.wait_for_query_tool_loading_indicator_to_disappear()
def _query_tool_auto_commit_enabled(self):
query = """-- 1. Enable auto commit.
-- 2. END any open transaction.
-- 3. Create table in public schema.
@ -749,7 +748,7 @@ SELECT 1, pg_sleep(300)"""
show_jit = pg_cursor.fetchone()
if show_jit[0] == 'on':
jit_enabled = True
except:
except Exception as e:
pass
is_edb = False

View File

@ -185,12 +185,12 @@ class PgadminPage:
"""The function will be used for opening Trees node only"""
# get the element which contains 'aria-expanded' info
tables_expansion_ele =self.find_by_xpath("//div[div[div[div[div[div"
"[div[div[span[span["
"(@class='aciTreeText') and "
"text()='Tables']]]]]]]]]]")
tables_expansion_ele = self.find_by_xpath("//div[div[div[div[div[div"
"[div[div[span[span["
"(@class='aciTreeText') and "
"text()='Tables']]]]]]]]]]")
if tables_expansion_ele.get_attribute('aria-expanded') =='false':
if tables_expansion_ele.get_attribute('aria-expanded') == 'false':
# button element of the Tables node to open it
item_button = self.find_by_xpath(
"//div[span[span[(@class='aciTreeText') and text()"
@ -394,9 +394,9 @@ class PgadminPage:
element_found = False
try:
WebDriverWait(self.driver, timeout, .01).until(
EC.visibility_of_element_located((By.XPATH, xpath)))
EC.visibility_of_element_located((By.XPATH, xpath)))
element_found = True
except:
except Exception as e:
pass
return element_found