ó
E®Uc           @   sl   d  Z  d d l m Z d d l m Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ d
 S(   s   Tests for samba.hostconfig.iÿÿÿÿ(   t   SharesContainer(   t   TestCaset   MockServicec           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   | |  _  d  S(   N(   t   data(   t   selfR   (    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyt   __init__   s    c         C   s   |  j  | S(   N(   R   (   R   t   name(    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyt   __getitem__   s    (   t   __name__t
   __module__R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyR      s   	t   MockLoadParmc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s   | |  _  d  S(   N(   R   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyR   #   s    c         C   s   t  |  j | ƒ S(   N(   R   R   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyR   &   s    c         C   s   t  |  j ƒ S(   N(   t   lenR   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyt   __len__)   s    c         C   s   |  j  j ƒ  S(   N(   R   t   keys(   R   (    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyt   services,   s    (   R   R	   R   R   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyR
   !   s   			t
   ShareTestsc           B   s>   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s   t  t | ƒ ƒ S(   N(   R    R
   (   R   t   conf(    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyt   _get_shares2   s    c         C   s)   |  j  i  ƒ } |  j d t | ƒ ƒ d  S(   Ni    (   R   t   assertEqualsR   (   R   t   shares(    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyt   test_len_no_global5   s    c         C   sy   |  j  g  t |  j i  ƒ ƒ ƒ |  j  g  t |  j i i  d 6ƒ ƒ ƒ |  j  d g t |  j i i  d 6i  d 6ƒ ƒ ƒ d  S(   Nt   globalt   bla(   R   t   listR   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyt	   test_iter9   s
    &c         C   s0   |  j  i i  d 6ƒ } |  j d t | ƒ ƒ d  S(   NR   i    (   R   R   R   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyt   test_len@   s    c         C   s0   |  j  i i  d 6ƒ } |  j t | j d ƒ d  S(   NR   R   (   R   t   assertRaisest   KeyErrorR   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyt   test_getitem_nonexistentD   s    c         C   s0   |  j  i i  d 6ƒ } |  j t | j d ƒ d  S(   NR   (   R   R   R   R   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyt   test_getitem_globalH   s    (   R   R	   R   R   R   R   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyR   0   s   					N(	   t   __doc__t   samba.hostconfigR    t   samba.testsR   t   objectR   R
   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/samba/tests/hostconfig.pyt   <module>   s
   	