ó
ôxTc           @   sL   d  d l  m Z d   Z d   Z d   Z e d k rH e   e   n  d S(   i˙˙˙˙(   t   divisionc          C   s6  d d  l  }  y |  j j d  } Wn t k
 r= } d GHd  SXd d  l } d d l m } d d l m } xŔ |   D]ľ \ } } | j	 j
 | d | |  } | j |  }	 |	 |  }
 |
 j   } | d  k	 rá | d j   } n  |
 j   } |
 j   } |
 j   } y |
 j   } Wqt t k
 r(qt Xqt Wd GHd  S(	   Ni˙˙˙˙t   dials_regressions%   FAIL: dials_regression not configured(   t   Registry(   t   get_all_working_imagest   image_examplesi    t   OK(   t   libtbx.load_envt   envt	   dist_patht   KeyErrort   ost   dxtbx.format.RegistryR   t6   dials_regression.image_examples.get_all_working_imagesR   t   patht   joint   findt   get_detectort   Nonet   get_image_sizet   get_beamt   get_goniometert   get_scant   get_raw_datat   IOError(   t   libtbxR   t   eR
   R   R   t	   directoryt   imaget	   file_patht   formatt   it   dett   sizet   bt   gt   st   d(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/tests/tst_dxtbx.pyt	   tst_dxtbx   s2    c          C   s`   d d l  m }  |    d d l m } |   d d l m } |   d d l m } |   d  S(   Ni˙˙˙˙(   t	   test_beam(   t   test_detector(   t   test_goniometer(   t	   test_scan(   t   dxtbx.tests.test_beamR&   t   dxtbx.tests.test_detectorR'   t   dxtbx.tests.test_goniometerR(   t   dxtbx.tests.test_scanR)   (   R&   R'   R(   R)   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/tests/tst_dxtbx.pyt   tst_dxtbx_models$   s    c          C   s   d d l  m }  i d d 6d d 6d d 6d	 d
 6d d 6d d 6} x4 | D], } |  |  } | d | | k sG t  qG Wd GHd  S(   Ni˙˙˙˙(   t   template_regexs   foo_bar_###.imgs   foo_bar_001.imgs   foo_bar###.imgs   foo_bar001.imgs   foo_bar_1.8A_###.imgs   foo_bar_1.8A_001.imgs   foo_bar.###s   foo_bar.001s   foo_bar_###.img1000s   foo_bar_001.img1000s   foo_bar_#####.imgs   foo_bar_00001.imgi    R   (   t   dxtbx.sweep_filenamesR/   t   AssertionError(   R/   t   questions_answerst   filenamet   answer(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/tests/tst_dxtbx.pyt	   tst_sweep4   s    
t   __main__N(   t
   __future__R    R%   R.   R5   t   __name__(    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/tests/tst_dxtbx.pyt   <module>   s   	"		