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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xueyun Qian
erp5
Commits
70e85adb
Commit
70e85adb
authored
Aug 07, 2017
by
Iliya Manolov
Committed by
Łukasz Nowak
Sep 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for required eggs in Jupyter
Clone of
nexedi/erp5!339
/reviewed-on
nexedi/erp5!391
parent
bbb4585e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletion
+43
-1
bt5/erp5_data_notebook/TestTemplateItem/portal_components/test.erp5.testExecuteJupyter.py
...ateItem/portal_components/test.erp5.testExecuteJupyter.py
+43
-1
No files found.
bt5/erp5_data_notebook/TestTemplateItem/portal_components/test.erp5.testExecuteJupyter.py
View file @
70e85adb
...
@@ -1011,4 +1011,46 @@ print os.path
...
@@ -1011,4 +1011,46 @@ print os.path
self
.
tic
()
self
.
tic
()
result
=
json
.
loads
(
result
)
result
=
json
.
loads
(
result
)
self
.
assertEquals
(
result
[
'status'
],
'ok'
)
self
.
assertEquals
(
result
[
'status'
],
'ok'
)
\ No newline at end of file
def
checkEgg
(
self
,
egg
):
'''
Returns whether an egg is available.
'''
reference
=
'Test.Notebook.EnvironmentObject.Errors.EggImport'
try
:
result
=
self
.
portal
.
Base_executeJupyter
(
reference
=
reference
,
python_expression
=
'import %s as _'
%
egg
)
except
Exception
:
result
=
json
.
dumps
(
dict
(
status
=
'error'
))
self
.
tic
()
result
=
json
.
loads
(
result
)
return
result
[
'status'
]
==
'ok'
def
testEggs
(
self
):
'''
Test whether essential modules are available.
'''
self
.
login
(
'dev_user'
)
egg_list
=
[
'datetime'
,
'h5py'
,
'math'
,
'matplotlib'
,
'openpyxl'
,
'pandas'
,
'pylab'
,
'scipy'
,
'sklearn'
,
'statsmodels'
,
'sympy'
,
]
imported_egg_list
=
[
egg
for
egg
in
egg_list
if
self
.
checkEgg
(
egg
)]
self
.
assertEqual
(
set
(
egg_list
),
set
(
imported_egg_list
))
\ No newline at end of file
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