ó
ù2¢\c           @   s\   d  Z  d d l Z d d l m Z d d l m Z d d l m Z d e f d „  ƒ  YZ d S(   s   Test the basic /api endpointsiÿÿÿÿN(   t	   isoformat(   t   url_path_join(   t   NotebookTestBaset   KernelAPITestc           B   s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   s    Test the kernels web service APIc         K   s)   |  j  | t d | ƒ ƒ } | j ƒ  | S(   Nt   api(   t   requestR   t   raise_for_status(   t   selft   verbt   patht   kwargst   r(    (    sC   lib/python2.7/site-packages/notebook/services/api/tests/test_api.pyt   _req   s    
c         K   s   |  j  d | ƒ S(   Nt   GET(   R   (   R   R	   R
   (    (    sC   lib/python2.7/site-packages/notebook/services/api/tests/test_api.pyt   get   s    c         C   s"   |  j  d ƒ } | j s t ‚ d  S(   Ns	   spec.yaml(   R   t   textt   AssertionError(   R   R   (    (    sC   lib/python2.7/site-packages/notebook/services/api/tests/test_api.pyt   test_get_spec   s    c         C   s¦   |  j  d ƒ } | j ƒ  } | d d k s1 t ‚ | d d k sG t ‚ | d j d ƒ s` t ‚ | d j d ƒ sy t ‚ | d t |  j j j d ƒ k s¢ t ‚ d  S(   Nt   statust   connectionsi    t   kernelst   last_activityt   Zt   started(   R   t   jsonR   t   endswithR    t   notebookt   web_appt   settings(   R   R   t   data(    (    sC   lib/python2.7/site-packages/notebook/services/api/tests/test_api.pyt   test_get_status   s    (   t   __name__t
   __module__t   __doc__R   R   R   R   (    (    (    sC   lib/python2.7/site-packages/notebook/services/api/tests/test_api.pyR   
   s
   			(	   R!   t   requestst   notebook._tzR    t   notebook.utilsR   t   notebook.tests.launchnotebookR   R   (    (    (    sC   lib/python2.7/site-packages/notebook/services/api/tests/test_api.pyt   <module>   s
   