ó
bPc           @   s  d  Z  d d l Z d d l Z d d l Z d d l Z e j d Z e j j d ƒ Z	 y d d l
 Z Wn e k
 r~ d Z n Xy d d l Z Wn e k
 r¨ d Z n Xd e j f d „  ƒ  YZ d e f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ e d k re j ƒ  n  d S(   sÇ  Test OpenBabel Python bindings

On Windows or Linux, you can run these tests at the commandline
in the build folder with:
"C:\Program Files\CMake 2.6in\ctest.exe" -C CTestTestfile.cmake
                                           -R pybindtest -VV

The runtime directory is ${CMAKE_SRC_DIR}/test. 

You could also "chdir" into build and run the test file directly:
python ../../test/testbindings.py

In this latter case, you will need to set the environment variables
PYTHONPATH, LD_LIBRARY_PATH, BABEL_LIBDIR and BABEL_DATADIR beforehand.
The CMake script does this automatically.

In both cases, the test file is run directly from the source folder,
and so you can quickly develop the tests and try them out.
iÿÿÿÿNi    t   wint   PythonBindingsc           B   s   e  Z d  „  Z RS(   c         C   s   |  j  t d  k	 d ƒ d  S(   Ns%   Failed to import the openbabel module(   t
   assertTruet   obt   None(   t   self(    (    s4   /Users/ghutchis/Devel/openbabel/test/testbindings.pyt   setUp(   s    (   t   __name__t
   __module__R   (    (    (    s4   /Users/ghutchis/Devel/openbabel/test/testbindings.pyR   '   s   t   TestPythonBindingsc           B   s   e  Z d  „  Z RS(   c         C   sR   t  j ƒ  } t  j ƒ  } | j d ƒ | j | d ƒ |  j | j ƒ  d d ƒ d  S(   Nt   smis   CC(=O)Clg      S@i   (   R   t   OBMolt   OBConversiont   SetInFormatt
   ReadStringt   assertAlmostEqualt   GetMolWt(   R   t   molt   conv(    (    s4   /Users/ghutchis/Devel/openbabel/test/testbindings.pyt
   testSimple,   s
    (   R   R   R   (    (    (    s4   /Users/ghutchis/Devel/openbabel/test/testbindings.pyR	   +   s   t   PybelWrapperc           B   s   e  Z d  „  Z RS(   c         C   s   |  j  t d  k	 d ƒ d  S(   Ns!   Failed to import the Pybel module(   R   t   pybelR   (   R   (    (    s4   /Users/ghutchis/Devel/openbabel/test/testbindings.pyt	   testDummy5   s    (   R   R   R   (    (    (    s4   /Users/ghutchis/Devel/openbabel/test/testbindings.pyR   4   s   t   __main__(   t   __doc__t   ost   ret   syst   unittestt   patht   heret   platformt
   startswitht   iswint	   openbabelR   t   ImportErrorR   R   t   TestCaseR   R	   R   R   t   main(    (    (    s4   /Users/ghutchis/Devel/openbabel/test/testbindings.pyt   <module>   s&   

	