Commit d387bf47 by Andrew Gaylard

Fix pep8 and pylint problems.

parent 9f33c1d7
......@@ -35,9 +35,9 @@ class TestDragAndDropRender(BaseIntegrationTest):
def load_scenario(self, item_background_color="", item_text_color="", borders=False):
if borders:
json="integration/data/test_data_a11y_borders.json"
json = "integration/data/test_data_a11y_borders.json"
else:
json="integration/data/test_data_a11y.json"
json = "integration/data/test_data_a11y.json"
scenario_xml = """
<vertical_demo>
<drag-and-drop-v2 item_background_color='{item_background_color}'
......@@ -61,9 +61,9 @@ class TestDragAndDropRender(BaseIntegrationTest):
query = 'return $("{selector}").get(0).style.{style}'
return self.browser.execute_script(query.format(selector=selector, style=style))
def _get_border_style(self, id, style):
query = 'return window.getComputedStyle(document.getElementById("{id}"), null).getPropertyValue("{style}")'
return self.browser.execute_script(query.format(id=id, style=style))
def _get_border_style(self, elt, style):
query = 'return window.getComputedStyle(document.getElementById("{elt}"), null).getPropertyValue("{style}")'
return self.browser.execute_script(query.format(elt=elt, style=style))
def _assert_box_percentages(self, selector, left, top, width, height):
""" Assert that the element 'selector' has the specified position/size percentages """
......@@ -207,16 +207,16 @@ class TestDragAndDropRender(BaseIntegrationTest):
self.load_scenario()
zones = self._get_zones()
for index, zone in enumerate(zones):
id = 'zone-{}'.format(index + 1)
elt = 'zone-{}'.format(index + 1)
# Firefox does not provide a single "border-style", so we check "border-top-style"
self.assertEqual(self._get_border_style(id, 'border-top-style'), 'none')
self.assertEqual(self._get_border_style(id, 'border-top-width'), '0px')
self.assertEqual(self._get_border_style(elt, 'border-top-style'), 'none')
self.assertEqual(self._get_border_style(elt, 'border-top-width'), '0px')
def test_borders_active(self):
self.load_scenario("", "", True)
zones = self._get_zones()
for index, zone in enumerate(zones):
id = 'zone-{}'.format(index + 1)
self.assertEqual(self._get_border_style(id, 'border-top-style'), 'dotted')
self.assertEqual(self._get_border_style(id, 'border-top-width'), '1px')
self.assertEqual(self._get_border_style(id, 'border-top-color'), 'rgb(86, 86, 86)') # == #565656
elt = 'zone-{}'.format(index + 1)
self.assertEqual(self._get_border_style(elt, 'border-top-style'), 'dotted')
self.assertEqual(self._get_border_style(elt, 'border-top-width'), '1px')
self.assertEqual(self._get_border_style(elt, 'border-top-color'), 'rgb(86, 86, 86)') # == #565656
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment