diff --git a/bt5/erp5_data_notebook/TestTemplateItem/portal_components/test.erp5.testExecuteJupyter.py b/bt5/erp5_data_notebook/TestTemplateItem/portal_components/test.erp5.testExecuteJupyter.py index 89ea08915ddeaeabd7c646f8a2dda64283043900..ca0e1accc7fc752733d0600b0a9fc4707e91890c 100644 --- a/bt5/erp5_data_notebook/TestTemplateItem/portal_components/test.erp5.testExecuteJupyter.py +++ b/bt5/erp5_data_notebook/TestTemplateItem/portal_components/test.erp5.testExecuteJupyter.py @@ -881,3 +881,46 @@ print dig self.tic() self.assertEquals(result, True) + +def testNPArrayPrint(self): + self.login('dev_user') + import_code = ''' +import numpy as np +''' + reference = 'Test.Notebook.EnvironmentObject.Errors.NPArrayTest' + result = self.portal.Base_executeJupyter( + reference=reference, + python_expression=import_code + ) + self.tic() + + result = json.loads(result) + self.assertEquals(result['status'], 'ok') + + jupyter_code = ''' +print np.random.rand(256, 256, 256) +''' + + result = self.portal.Base_executeJupyter( + reference=reference, + python_expression=jupyter_code + ) + self.tic() + + result = json.loads(result) + self.assertEquals(result['status'], 'ok') + + jupyter_code = ''' +print np.random.randint(low = 2 ** 63 - 1, size = (256, 256, 256), dtype = 'int64') +''' + + result = self.portal.Base_executeJupyter( + reference=reference, + python_expression=jupyter_code + ) + self.tic() + + result = json.loads(result) + self.assertEquals(result['status'], 'ok') + + \ No newline at end of file