improved test.py
added ImportError and imporoved test.py
added InvalidObjectException,WrapperException,NotImplementedError,MemoryError and changed from static to dynamic_cast in Engine