ó
4Mc           @   sb   d  d l  Z  d  d l m Z d  d l m Z d e  j f d „  ƒ  YZ e d k r^ e  j ƒ  n  d S(   iÿÿÿÿN(   t   opml2config(   t   ConfigParsert   OpmlTestc           B   sÔ   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s'   
    Test the opml2config function
    c         C   s   t  ƒ  |  _ d  S(   N(   R   t   config(   t   self(    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   setUp   s    c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   Ns   <outline type="rss"
                                xmlUrl="http://example.com/feed.xml"
                                text="sample feed"/>s   sample feeds   http://example.com/feed.xmlt   name(   R    R   t   assertEqualt   get(   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_outline_element   s    	c         C   s-   t  d |  j ƒ |  j |  j j d ƒ ƒ d  S(   Ns   <feed    type="rss"
                                xmlUrl="http://example.com/feed.xml"
                                text="sample feed"/>s   http://example.com/feed.xml(   R    R   t   assertFalset   has_section(   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_wrong_element   s    c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   Ns·   <bad stuff before>
                       <outline type="rss"
                                xmlUrl="http://example.com/feed.xml"
                                text="sample feed"/>s   sample feeds   http://example.com/feed.xmlR   (   R    R   R   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_illformed_xml_before    s    	c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   Ns¶   <outline type="rss"
                                xmlUrl="http://example.com/feed.xml"
                                text="sample feed"/>
                       <bad stuff after>s   sample feeds   http://example.com/feed.xmlR   (   R    R   R   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_illformed_xml_after(   s    	c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   Ns‚   <outline
                                xmlUrl="http://example.com/feed.xml"
                                text="sample feed"/>s   sample feeds   http://example.com/feed.xmlR   (   R    R   R   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_type_missing4   s    	c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   Ns   <outline type="RSS"
                                xmlUrl="http://example.com/feed.xml"
                                text="sample feed"/>s   sample feeds   http://example.com/feed.xmlR   (   R    R   R   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_type_uppercase;   s    	c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   NsŽ   <outline type="atom"
                                xmlUrl="http://example.com/feed.xml"
                                text="sample feed"/>s   sample feeds   http://example.com/feed.xmlR   (   R    R   R   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_type_atomB   s    	c         C   s-   t  d |  j ƒ |  j |  j j d ƒ ƒ d  S(   Ns   <outline type="other"
                                xmlUrl="http://example.com/feed.xml"
                                text="sample feed"/>s   http://example.com/feed.xml(   R    R   R
   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_wrong_typeI   s    c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   NsŽ   <outline type="link"
                                xmlUrl="http://example.com/feed.xml"
                                text="sample feed"/>s   sample feeds   http://example.com/feed.xmlR   (   R    R   R   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_WordPress_link_managerO   s    	c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   Ns   <outline type="rss"
                                xmlurl="http://example.com/feed.xml"
                                text="sample feed"/>s   sample feeds   http://example.com/feed.xmlR   (   R    R   R   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_xmlurl_wrong_case[   s    	c         C   s-   t  d |  j ƒ |  j |  j j d ƒ ƒ d  S(   NsH   <outline type="rss"
                                text="sample feed"/>s   http://example.com/feed.xml(   R    R   R
   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_missing_xmlUrlb   s    c         C   s-   t  d |  j ƒ |  j |  j j d ƒ ƒ d  S(   Nsr   <outline type="rss"
                                xmlUrl=""
                                text="sample feed"/>t    (   R    R   R
   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_blank_xmlUrlg   s    c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   NsŽ   <outline type="rss"
                                xmlUrl="http://example.com/feed.xml"
                                title="sample feed"/>s   sample feeds   http://example.com/feed.xmlR   (   R    R   R   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_title_attributeq   s    	c         C   s-   t  d |  j ƒ |  j |  j j d ƒ ƒ d  S(   Ns{   <outline type="rss"
                                xmlUrl="http://example.com/feed.xml"
                                />s   http://example.com/feed.xml(   R    R   R
   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_missing_textx   s    c         C   s-   t  d |  j ƒ |  j |  j j d ƒ ƒ d  S(   Ns‚   <outline type="rss"
                                xmlUrl="http://example.com/feed.xml"
                                text=""/>s   http://example.com/feed.xml(   R    R   R
   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_blank_text_no_title~   s    c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   Ns¶   <outline type="rss"
                                xmlUrl="http://example.com/feed.xml"
                                text=""
                                title="sample feed"/>s   sample feeds   http://example.com/feed.xmlR   (   R    R   R   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_blank_text_with_title„   s    	c         C   s-   t  d |  j ƒ |  j |  j j d ƒ ƒ d  S(   Ns«   <outline type="rss"
                                xmlUrl="http://example.com/feed.xml"
                                text=""
                                title=""/>s   http://example.com/feed.xml(   R    R   R
   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_blank_text_blank_titleŒ   s    c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   Ns‘   <outline type="rss"
                                xmlUrl="http://example.com/feed.xml"
                                text="SeÃ±or Frogâ€™s"/>s   SeÃ±or Frogâ€™ss   http://example.com/feed.xmlR   (   R    R   R   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_text_utf8“   s
    
	c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   NsŽ   <outline type="rss"
                                xmlUrl="http://example.com/feed.xml"
                                text="Señor Frog’s"/>s   SeÃ±or Frogâ€™ss   http://example.com/feed.xmlR   (   R    R   R   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_text_win_1252›   s    	c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   Ns›   <outline type="rss"
                                xmlUrl="http://example.com/feed.xml"
                                text="Se&ntilde;or Frog&rsquo;s"/>s   SeÃ±or Frogâ€™ss   http://example.com/feed.xmlR   (   R    R   R   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_text_entity¢   s    	c         C   s3   t  d |  j ƒ |  j d |  j j d d ƒ ƒ d  S(   Ns£   <outline type="rss"
                                xmlUrl="http://example.com/feed.xml"
                                text="Se&amp;ntilde;or Frog&amp;rsquo;s"/>s   SeÃ±or Frogâ€™ss   http://example.com/feed.xmlR   (   R    R   R   R   (   R   (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   test_text_double_escaped©   s    	(   t   __name__t
   __module__t   __doc__R   R	   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R    (    (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyR      s.   													
								t   __main__(   t   unittestt   planet.opmlR    R   t   TestCaseR   R!   t   main(    (    (    s<   /home/sa3ruby/intertwingly.net/code/venus/tests/test_opml.pyt   <module>   s
   ©