Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-drag-and-drop-v2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
xblock-drag-and-drop-v2
Commits
d387bf47
Commit
d387bf47
authored
Jan 12, 2016
by
Andrew Gaylard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pep8 and pylint problems.
parent
9f33c1d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
tests/integration/test_render.py
+12
-12
No files found.
tests/integration/test_render.py
View file @
d387bf47
...
@@ -35,9 +35,9 @@ class TestDragAndDropRender(BaseIntegrationTest):
...
@@ -35,9 +35,9 @@ class TestDragAndDropRender(BaseIntegrationTest):
def
load_scenario
(
self
,
item_background_color
=
""
,
item_text_color
=
""
,
borders
=
False
):
def
load_scenario
(
self
,
item_background_color
=
""
,
item_text_color
=
""
,
borders
=
False
):
if
borders
:
if
borders
:
json
=
"integration/data/test_data_a11y_borders.json"
json
=
"integration/data/test_data_a11y_borders.json"
else
:
else
:
json
=
"integration/data/test_data_a11y.json"
json
=
"integration/data/test_data_a11y.json"
scenario_xml
=
"""
scenario_xml
=
"""
<vertical_demo>
<vertical_demo>
<drag-and-drop-v2 item_background_color='{item_background_color}'
<drag-and-drop-v2 item_background_color='{item_background_color}'
...
@@ -61,9 +61,9 @@ class TestDragAndDropRender(BaseIntegrationTest):
...
@@ -61,9 +61,9 @@ class TestDragAndDropRender(BaseIntegrationTest):
query
=
'return $("{selector}").get(0).style.{style}'
query
=
'return $("{selector}").get(0).style.{style}'
return
self
.
browser
.
execute_script
(
query
.
format
(
selector
=
selector
,
style
=
style
))
return
self
.
browser
.
execute_script
(
query
.
format
(
selector
=
selector
,
style
=
style
))
def
_get_border_style
(
self
,
id
,
style
):
def
_get_border_style
(
self
,
elt
,
style
):
query
=
'return window.getComputedStyle(document.getElementById("{
id
}"), null).getPropertyValue("{style}")'
query
=
'return window.getComputedStyle(document.getElementById("{
elt
}"), null).getPropertyValue("{style}")'
return
self
.
browser
.
execute_script
(
query
.
format
(
id
=
id
,
style
=
style
))
return
self
.
browser
.
execute_script
(
query
.
format
(
elt
=
elt
,
style
=
style
))
def
_assert_box_percentages
(
self
,
selector
,
left
,
top
,
width
,
height
):
def
_assert_box_percentages
(
self
,
selector
,
left
,
top
,
width
,
height
):
""" Assert that the element 'selector' has the specified position/size percentages """
""" Assert that the element 'selector' has the specified position/size percentages """
...
@@ -207,16 +207,16 @@ class TestDragAndDropRender(BaseIntegrationTest):
...
@@ -207,16 +207,16 @@ class TestDragAndDropRender(BaseIntegrationTest):
self
.
load_scenario
()
self
.
load_scenario
()
zones
=
self
.
_get_zones
()
zones
=
self
.
_get_zones
()
for
index
,
zone
in
enumerate
(
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"
# 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
(
elt
,
'border-top-style'
),
'none'
)
self
.
assertEqual
(
self
.
_get_border_style
(
id
,
'border-top-width'
),
'0px'
)
self
.
assertEqual
(
self
.
_get_border_style
(
elt
,
'border-top-width'
),
'0px'
)
def
test_borders_active
(
self
):
def
test_borders_active
(
self
):
self
.
load_scenario
(
""
,
""
,
True
)
self
.
load_scenario
(
""
,
""
,
True
)
zones
=
self
.
_get_zones
()
zones
=
self
.
_get_zones
()
for
index
,
zone
in
enumerate
(
zones
):
for
index
,
zone
in
enumerate
(
zones
):
id
=
'zone-{}'
.
format
(
index
+
1
)
elt
=
'zone-{}'
.
format
(
index
+
1
)
self
.
assertEqual
(
self
.
_get_border_style
(
id
,
'border-top-style'
),
'dotted'
)
self
.
assertEqual
(
self
.
_get_border_style
(
elt
,
'border-top-style'
),
'dotted'
)
self
.
assertEqual
(
self
.
_get_border_style
(
id
,
'border-top-width'
),
'1px'
)
self
.
assertEqual
(
self
.
_get_border_style
(
elt
,
'border-top-width'
),
'1px'
)
self
.
assertEqual
(
self
.
_get_border_style
(
id
,
'border-top-color'
),
'rgb(86, 86, 86)'
)
# == #565656
self
.
assertEqual
(
self
.
_get_border_style
(
elt
,
'border-top-color'
),
'rgb(86, 86, 86)'
)
# == #565656
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment