Salome HOME
modification cas telemac, non fonctionnel
[modules/hydro.git] / doc / salome / examples / h006_importBathyXYZBad.py
index 3a24a9f2fc93c26e44b078d44180400d403fbdf4..a5dae4f55ff9447f523347eff97e13b8ffd02532 100644 (file)
@@ -10,8 +10,8 @@ salome.salome_init()
 theStudy = salome.myStudy
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
@@ -21,12 +21,10 @@ Cloud_inexistant = hydro_doc.CreateObject( KIND_BATHYMETRY )
 Cloud_inexistant.SetName( "Cloud_inexistant" )
 
 Cloud_inexistant.SetAltitudesInverted( 0 );
-Cloud_inexistant.ImportFromFile( os.path.join(HYDRO_SAMPLES,  "Cloud_inexistant.xyz" ))
+ret = Cloud_inexistant.ImportFromFile( os.path.join(HYDRO_SAMPLES,  "Cloud_inexistant.xyz" ))
 
-# TODO : ce chargement doit echouer avec un retour d'erreur à traiter
-raise ValueError('file not found')
-
-Cloud_inexistant.Update()
+if ret:
+  raise ValueError('loading problem not detected: return value should be null')
 
 if salome.sg.hasDesktop():
   salome.sg.updateObjBrowser(1)