Salome HOME
Corrections of examples path after install with scbi
[modules/hydro.git] / doc / salome / examples / h006_importBathyXYZBad.py
index 3a24a9f2fc93c26e44b078d44180400d403fbdf4..c7d663775fc92f4e33f8888152942d6cfdbd61b6 100644 (file)
@@ -1,19 +1,18 @@
 # -*- coding: utf-8 -*-
 
 import os
-HYDRO_SAMPLES = os.path.join( os.environ["HYDRO_ROOT_DIR"], "bin/salome/test/HYDRO")
+HYDRO_SAMPLES = os.path.join( os.environ["HYDRO_ROOT_DIR"], "bin/salome/test")
 
 import sys
 import salome
 
 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() )
+hydro_doc = HYDROData_Document.Document()
 
 hydro_doc.SetLocalCS( 430000, 6.35e+06 )
 
@@ -21,12 +20,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)
+  salome.sg.updateObjBrowser()