mò
ú]+Hc           @   sG   d  k  l Z d k l Z d k l Z l Z d e f d „  ƒ  YZ d S(   (   s   TestCaseWithMediaData(   s   CommandFactory(   s   DeejaydXMLCommands   DeejaydXMLAnswerFactoryt   TestDeejaydProtocolc           B   s,   t  Z d „  Z d „  Z d „  Z d „  Z RS(   Nc         C   s)   t  i |  ƒ t ƒ  |  _ t ƒ  |  _ d  S(   N(   t   TestCaseWithMediaDatat   setUpt   selft   CommandFactoryt
   cmdFactoryt   DeejaydXMLAnswerFactoryt
   rspFactory(   R   (    (    tU   /mnt/perso/roy/Documents/Repository/deejayd--release/src/testdeejayd/test_protocol.pyR      s    c         C   s   t  i |  ƒ d  S(   N(   R   t   tearDownR   (   R   (    (    R   R	       s    c         C   s\   t  d ƒ } |  i i | i ƒ  ƒ } |  i i d | i	 ƒ } |  i | i ƒ  | i ƒ  ƒ d S(   s)   Send a ping command with the XML protocolt   pingt   AckN(   t   DeejaydXMLCommandt   xmlcmdR   R   t   createCmdFromXMLt   to_xmlt   cmdR   t   get_deejayd_xml_answert   namet   anst   assertEqualt   execute(   R   R   R   R   (    (    R   t   testXMLPingCommand#   s
     c         C   sv   |  i i ƒ  } t | ƒ } |  i i | ƒ } |  i	 i
 d | i ƒ } | i d | ƒ |  i | i ƒ  | i ƒ  ƒ d S(   s,   Send a unknown command with the XML protocolt   errors   Unknown command : %sN(   R   t   testdatat   getRandomStringt   cmdNameR   R   R   R   R   R   R   R   R   t   set_error_textt
   failUnlessR   R   (   R   R   R   R   R   (    (    R   t   testXMLUnknownCommand*   s     (   t   __name__t
   __module__R   R	   R   R   (    (    (    R   R       s   			N(   t   testdeejaydR   t   deejayd.net.deejaydProtocolR   t   deejayd.net.xmlbuildersR   R   R    (   R   R   R   R    R   (    (    R   t   ?   s   