ó
ÎYc           @   s¥   d  Z  d d l Z d d l Z d d l Z d d l m Z d e f d „  ƒ  YZ	 e j
 d d ƒ d „  ƒ Z e j
 d d ƒ d	 „  ƒ Z e j
 d d ƒ d
 „  ƒ Z d S(   s(   Defines chart-wide shared test fixtures.iÿÿÿÿN(   t   autompgt   TestDatac           B   s    e  Z d  Z d „  Z d „  Z RS(   s?   Contains properties with easy access to data used across tests.c         C   sÍ   d d d d g |  _  d d d d g d d d d g g |  _ g  |  j D] } t j | ƒ ^ qF |  _ i |  j d	 d
 6|  j d d 6|  _ t j |  j ƒ |  _ |  j j	 d d ƒ |  _
 t |  _ |  j ƒ  d  S(   Nt   at   ct   bi   i   i   i   i   i    t   col1t   col2t   orientt   records(   t   cat_listt	   list_datat   npt   arrayt
   array_datat	   dict_datat   pdt	   DataFramet   pd_datat   to_dictt   records_dataR    t	   auto_datat   _setup_auto_mpg(   t   selft   item(    (    s0   lib/python2.7/site-packages/bkcharts/conftest.pyt   __init__   s    '(	c         C   sq   |  j  d d k |  j  d <t j j |  j  d ƒ } t t t | j j j	 ƒ  ƒ ƒ ƒ } | j
 | ƒ |  j  d <d  S(   Nt   displi^  t   large_displt   cylt   reversed_cyl(   R   R   t   Categoricalt
   from_arrayt   listt   reversedt   sortedt
   categoriest   valuest   tolistt   reorder_categories(   R   t   catt	   new_order(    (    s0   lib/python2.7/site-packages/bkcharts/conftest.pyR      s    $(   t   __name__t
   __module__t   __doc__R   R   (    (    (    s0   lib/python2.7/site-packages/bkcharts/conftest.pyR   
   s   	t   scopet   modulec           C   s   t  ƒ  S(   N(   R   (    (    (    s0   lib/python2.7/site-packages/bkcharts/conftest.pyt	   test_data#   s    c         C   s    |  j  j ƒ  } |  j | d <| S(   Nt   col3(   R   t   copyR	   (   R-   t   data(    (    s0   lib/python2.7/site-packages/bkcharts/conftest.pyt   wide_data_with_cat(   s    c         C   s   t  j |  j d |  j ƒS(   Nt   index(   R   R   R   R	   (   R-   (    (    s0   lib/python2.7/site-packages/bkcharts/conftest.pyt   df_with_cat_index/   s    (   R*   t   numpyR   t   pandasR   t   pytestt   bokeh.sampledata.autompgR    t   objectR   t   fixtureR-   R1   R3   (    (    (    s0   lib/python2.7/site-packages/bkcharts/conftest.pyt   <module>   s   