# --
# Copyright (C) CEA, EDF
# Author : Erwan ADAM (CEA)
# --

import unittest

class XDataTestTestCase(unittest.TestCase):
    def test(self):
        from xsalome import XSalomeSession
        salome = XSalomeSession(modules=["TECHOBJ"], logger=1)
        #
        import TECHOBJusecase
        # --
        # Testing the hidden corba objects
        to = TECHOBJusecase.to
        self.failIfEqual(to.__corba__component__, None)
        to = to.__corba__object__
        shape = to.getShape()
        bounds = shape.getBounds()
        self.failUnlessEqual(bounds, [-1.0, 1.0, -1.0, 1.0])
##        # --
##        # Testing if xtype accept corba objects
##        # since it is needed from salome gui ...
##        from technologyobject import TechnologyObject
##        xattrs = TechnologyObject.getAllInitXAttributes()
##        shape_xattr = None
##        for x in xattrs:
##            if x.name == "shape":
##                shape_xattr = x
##                break
##            pass
##        xtype = x.xtype
##        xtype(shape)
        #
        return
    pass

if __name__ == '__main__':
    unittest.main()
    pass
