ó
‹²,]c           @   sº   d  Z  d d l Z d d l Z d d l m Z m Z e j j e j j e j	 ƒ  e j j
 e ƒ ƒ ƒ Z d „  Z e j j d d d d d d g ƒ d „  ƒ Z e d k r¶ e j ƒ  n  d S(   s   Tests for encodings.pyiÿÿÿÿN(   t   is_text_filet
   get_codingc         C   sG   |  j  d ƒ j d ƒ } | j d ƒ t t | ƒ ƒ t k sC t ‚ d  S(   Nt   subs   random_text.txts   Some random text(   t   mkdirt   joint   writeR    t   strt   Truet   AssertionError(   t   tmpdirt   p(    (    s?   lib/python2.7/site-packages/spyder/utils/tests/test_encoding.pyt   test_is_text_file   s    s   expected_encoding, text_files   utf-8s	   utf-8.txts   windows-1252s   windows-1252.txtt   asciis	   ascii.txtt   Big5s   Big5.txts   KOI8-Rs
   KOI8-R.txtc         C   s[   t  t j j t | ƒ d ƒ 7 } | j ƒ  } t | ƒ j ƒ  |  j ƒ  k sQ t ‚ Wd  QXd  S(   Nt   rb(	   t   opent   ost   pathR   t   __location__t   readR   t   lowerR   (   t   expected_encodingt	   text_filet   ft   text(    (    s?   lib/python2.7/site-packages/spyder/utils/tests/test_encoding.pyt   test_files_encodings   s    	!t   __main__(   s   utf-8s	   utf-8.txt(   s   windows-1252s   windows-1252.txt(   R   s	   ascii.txt(   R   s   Big5.txt(   s   KOI8-Rs
   KOI8-R.txt(   t   __doc__t   pytestR   t   spyder.utils.encodingR    R   R   t   realpathR   t   getcwdt   dirnamet   __file__R   R   t   markt   parametrizeR   t   __name__t   main(    (    (    s?   lib/python2.7/site-packages/spyder/utils/tests/test_encoding.pyt   <module>   s   		