AlkantarClanX12
Current Path : /opt/alt/python33/lib64/python3.3/unittest/__pycache__/ |
Current File : //opt/alt/python33/lib64/python3.3/unittest/__pycache__/util.cpython-33.pyo |
� ��f= c @ s� d Z d d l m Z m Z d Z d Z d d d � Z d d � Z d d � Z d d � Z d d � Z e d d � Z d d � Z d d � Z d d � Z d S( u Various utility functions.i ( u namedtupleu OrderedDictiP c C sc y t | � } Wn! t k r3 t j | � } Yn X| sM t | � t k rQ | S| d t � d S( Nu [truncated]...( u repru Exceptionu objectu __repr__u lenu _MAX_LENGTH( u obju shortu result( ( u2 /opt/alt/python33/lib64/python3.3/unittest/util.pyu safe_repr s u safe_reprc C s d | j | j f S( Nu %s.%s( u __module__u __name__( u cls( ( u2 /opt/alt/python33/lib64/python3.3/unittest/util.pyu strclass s u strclassc C sn d } } g } g } xKy| | } | | } | | k rw | j | � | d 7} x� | | | k rs | d 7} qV Wn� | | k r� | j | � | d 7} x | | | k r� | d 7} q� Wn^ | d 7} z% x | | | k r� | d 7} q� WWd | d 7} x | | | k r| d 7} q� WXWq t k r`| j | | d � � | j | | d � � PYq Xq | | f S( ur Finds elements in only one or the other of two, sorted input lists. Returns a two-element tuple of lists. The first list contains those elements in the "expected" list but not in the "actual" list, and the second contains those elements in the "actual" list but not in the "expected" list. Duplicate elements in either input list are ignored. i i N( u appendu IndexErroru extend( u expectedu actualu iu ju missingu unexpectedu eu a( ( u2 /opt/alt/python33/lib64/python3.3/unittest/util.pyu sorted_list_difference s: u sorted_list_differencec C s\ g } xI | rQ | j � } y | j | � Wq t k rM | j | � Yq Xq W| | f S( u� Same behavior as sorted_list_difference but for lists of unorderable items (like dicts). As it does a linear search per item (remove) it has O(n*n) performance.( u popu removeu ValueErroru append( u expectedu actualu missingu item( ( u2 /opt/alt/python33/lib64/python3.3/unittest/util.pyu unorderable_list_difference= s u unorderable_list_differencec C s | | k | | k S( u. Return -1 if x < y, 0 if x == y and 1 if x > y( ( u xu y( ( u2 /opt/alt/python33/lib64/python3.3/unittest/util.pyu three_way_cmpN s u three_way_cmpu Mismatchu actual expected valuec C s� t | � t | � } } t | � t | � } } t � } g } x� t | � D]� \ } } | | k rl qN n d } } x>