]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
deux tests d'import de fichiers inexistants, bug à resoudre
authorPaul RASCLE <paul.rascle@edf.fr>
Wed, 28 Oct 2015 08:57:19 +0000 (09:57 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Wed, 28 Oct 2015 08:57:19 +0000 (09:57 +0100)
doc/salome/examples/CMakeLists.txt
doc/salome/examples/CTestTestfileInstall.cmake
doc/salome/examples/h005_importImageBad.py [new file with mode: 0644]
doc/salome/examples/h006_importBathyXYZBad.py [new file with mode: 0644]

index a5366abf2ec1e2b5c8e07e17610d4209d48669ed..3b3d33e245f09ee889383e44d0f669139c0b6320 100644 (file)
@@ -24,6 +24,8 @@ SET(EXAMPLES_TESTS
   h002_importImage.py
   h003_changeLCS.py
   h004_importBathyXYZ.py
+  h005_importImageBad.py
+  h006_importBathyXYZBad.py
 )
 
 SET(HYDRO_SAMPLES
index 42eaa35b00128de5dd89e715fea209eaf2b1dcfe..cbad141c9504c6e2b8545ae23c6f984d9c607934 100644 (file)
@@ -26,6 +26,8 @@ SET(EXAMPLES_TESTS
   h002_importImage
   h003_changeLCS
   h004_importBathyXYZ
+  h005_importImageBad
+  h006_importBathyXYZBad
 )
 
 FOREACH(tfile ${EXAMPLES_TESTS})
diff --git a/doc/salome/examples/h005_importImageBad.py b/doc/salome/examples/h005_importImageBad.py
new file mode 100644 (file)
index 0000000..e9ece75
--- /dev/null
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+
+import os
+HYDRO_SAMPLES = os.path.join( os.environ["HYDRO_ROOT_DIR"], "bin/salome/test/HYDRO")
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+from HYDROPy import *
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
+
+hydro_doc.SetLocalCS( 0, 0 )
+
+garonne_ign_inexistant = hydro_doc.CreateObject( KIND_IMAGE )
+garonne_ign_inexistant.SetName( "garonne_ign_inexistant" )
+
+garonne_ign_inexistant.LoadImage( os.path.join(HYDRO_SAMPLES , "garonne_ign_inexistant.png" ))
+
+# TODO : ce chargement doit echouer avec un retour d'erreur à traiter
+raise ValueError('file not found')
+
+garonne_ign_inexistant.SetLocalPoints( QPoint( 40, 817 ),
+                               QPoint( 1325, 85 ) )
+
+garonne_ign_inexistant.SetGlobalPoints( 1,
+                                QPointF( 471562, 6.36775e+06 ),
+                                QPointF( 489400, 6.37702e+06 ) )
+
+garonne_ign_inexistant.Update()
+
+if salome.sg.hasDesktop():
+  salome.sg.updateObjBrowser(1)
diff --git a/doc/salome/examples/h006_importBathyXYZBad.py b/doc/salome/examples/h006_importBathyXYZBad.py
new file mode 100644 (file)
index 0000000..3a24a9f
--- /dev/null
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+
+import os
+HYDRO_SAMPLES = os.path.join( os.environ["HYDRO_ROOT_DIR"], "bin/salome/test/HYDRO")
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+from HYDROPy import *
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
+
+hydro_doc.SetLocalCS( 430000, 6.35e+06 )
+
+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" ))
+
+# TODO : ce chargement doit echouer avec un retour d'erreur à traiter
+raise ValueError('file not found')
+
+Cloud_inexistant.Update()
+
+if salome.sg.hasDesktop():
+  salome.sg.updateObjBrowser(1)