Salome HOME
Python test scripts, first pass
[modules/hydro.git] / doc / salome / examples / h005_importImageBad.py
1 # -*- coding: utf-8 -*-
2
3 import os
4 HYDRO_SAMPLES = os.path.join( os.environ["HYDRO_ROOT_DIR"], "bin/salome/test/HYDRO")
5
6 import sys
7 import salome
8
9 salome.salome_init()
10 theStudy = salome.myStudy
11
12 from HYDROPy import *
13 from PyQt5.QtCore import *
14 from PyQt5.QtGui import *
15
16 hydro_doc = HYDROData_Document.Document()
17
18 hydro_doc.SetLocalCS( 0, 0 )
19
20 garonne_ign_inexistant = hydro_doc.CreateObject( KIND_IMAGE )
21 garonne_ign_inexistant.SetName( "garonne_ign_inexistant" )
22
23 ret = garonne_ign_inexistant.LoadImage( os.path.join(HYDRO_SAMPLES , "garonne_ign_inexistant.png" ))
24
25 if ret:
26   raise ValueError('loading problem not detected: return value should be null')
27
28 if salome.sg.hasDesktop():
29   salome.sg.updateObjBrowser()