Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Frederic Thoma
erp5
Commits
f71f2022
Commit
f71f2022
authored
May 19, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testXHTML: allow subclasses to adjust skins to be ignored by jslint
parent
cdeaa140
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
23 deletions
+17
-23
product/ERP5/tests/testXHTML.py
product/ERP5/tests/testXHTML.py
+17
-23
No files found.
product/ERP5/tests/testXHTML.py
View file @
f71f2022
...
@@ -49,8 +49,11 @@ class TestXHTMLMixin(ERP5TypeTestCase):
...
@@ -49,8 +49,11 @@ class TestXHTMLMixin(ERP5TypeTestCase):
# some forms have intentionally empty listbox selections like RSS generators
# some forms have intentionally empty listbox selections like RSS generators
FORM_LISTBOX_EMPTY_SELECTION_PATH_LIST
=
[
'erp5_web_widget_library/WebSection_viewContentListAsRSS'
]
FORM_LISTBOX_EMPTY_SELECTION_PATH_LIST
=
[
'erp5_web_widget_library/WebSection_viewContentListAsRSS'
]
IGNORE_FILE_LIST
=
[
'require.js'
,
'require.min.js'
,
'wz_dragdrop.js'
,
JSL_IGNORE_FILE_LIST
=
(
'require.js'
,
'require.min.js'
,
'wz_dragdrop.js'
,
'renderjs.js'
,
'jio.js'
,
'rsvp.js'
,
'handlebars.js'
]
'renderjs.js'
,
'jio.js'
,
'rsvp.js'
,
'handlebars.js'
)
JSL_IGNORE_SKIN_LIST
=
(
'erp5_ace_editor'
,
'erp5_code_mirror'
,
'erp5_fckeditor'
,
'erp5_jquery'
,
'erp5_jquery_ui'
,
'erp5_svg_editor'
,
'erp5_xinha_editor'
)
def
changeSkin
(
self
,
skin_name
):
def
changeSkin
(
self
,
skin_name
):
"""
"""
...
@@ -165,34 +168,25 @@ class TestXHTMLMixin(ERP5TypeTestCase):
...
@@ -165,34 +168,25 @@ class TestXHTMLMixin(ERP5TypeTestCase):
def
test_javascript_lint
(
self
):
def
test_javascript_lint
(
self
):
skins_tool
=
self
.
portal
.
portal_skins
skins_tool
=
self
.
portal
.
portal_skins
path_list
=
[]
path_list
=
[]
for
script_path
,
script
in
skins_tool
.
ZopeFind
(
for
script_path
,
script
in
skins_tool
.
ZopeFind
(
skins_tool
,
skins_tool
,
obj_metatypes
=
[
'File'
,
'DTML Method'
,
'DTML Document'
],
search_sub
=
1
):
obj_metatypes
=
(
'File'
,
'DTML Method'
,
'DTML Document'
),
search_sub
=
1
):
is_required_check_path
=
True
ignore_bts
=
[
'erp5_jquery'
,
'erp5_fckeditor'
,
'erp5_xinha_editor'
,
'erp5_svg_editor'
,
'erp5_jquery_ui'
,
'erp5_ace_editor'
,
'erp5_code_mirror'
]
if
script_path
.
endswith
(
'.js'
):
if
script_path
.
endswith
(
'.js'
):
for
ignore_bt_name
in
ignore_bts
:
x
=
script_path
.
split
(
'/'
,
1
)
if
script_path
.
startswith
(
ignore_bt_name
):
if
not
(
x
[
0
]
in
self
.
JSL_IGNORE_SKIN_LIST
or
is_required_check_path
=
False
x
[
1
]
in
self
.
JSL_IGNORE_FILE_LIST
):
for
ignore_file
in
self
.
IGNORE_FILE_LIST
:
if
script_path
.
endswith
(
ignore_file
):
is_required_check_path
=
False
if
is_required_check_path
:
path_list
.
append
(
script_path
)
path_list
.
append
(
script_path
)
def
jsl
(
check_path
):
portal_skins_path
=
self
.
portal
.
getId
()
+
'/portal_skins/'
args
=
(
'jsl'
,
'-stdin'
,
'-nologo'
,
'-nosummary'
,
'-conf'
,
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'jsl.conf'
))
for
path
in
path_list
:
check_path
=
portal_skins_path
+
path
body
=
self
.
publish
(
check_path
).
getBody
()
body
=
self
.
publish
(
check_path
).
getBody
()
conf_file
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'jsl.conf'
)
try
:
try
:
stdout
,
stderr
=
Popen
(
[
'jsl'
,
'-stdin'
,
'-nologo'
,
'-nosummary'
,
'-conf'
,
conf_file
]
,
stdout
,
stderr
=
Popen
(
args
,
stdin
=
PIPE
,
stdout
=
PIPE
,
stderr
=
PIPE
,
stdin
=
PIPE
,
stdout
=
PIPE
,
stderr
=
PIPE
,
close_fds
=
True
).
communicate
(
body
)
close_fds
=
True
).
communicate
(
body
)
except
OSError
,
e
:
except
OSError
,
e
:
raise
OSError
,
'%r
\
n
%r'
%
(
os
.
environ
,
e
)
raise
OSError
,
'%r
\
n
%r'
%
(
os
.
environ
,
e
)
self
.
assertEqual
(
stdout
,
''
,
'jsl result of %s : %s'
%
(
check_path
,
stdout
))
self
.
assertEqual
(
stdout
,
''
,
'jsl result of %s : %s'
%
(
check_path
,
stdout
))
portal_skins_path
=
'%s/portal_skins'
%
self
.
portal
.
getId
()
for
path
in
path_list
:
check_path
=
'%s/%s'
%
(
portal_skins_path
,
path
)
jsl
(
check_path
)
def
test_html_file
(
self
):
def
test_html_file
(
self
):
path_list
=
os
.
environ
.
get
(
'CGI_PATH'
,
path_list
=
os
.
environ
.
get
(
'CGI_PATH'
,
...
...
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