
    5P@iw                        d Z ddlmZ ddlmZ ddlmZ ddlmZ  G d dej                        Z	e
dk(  r ej                          y	y	)
zUnittest for html_utils.    )annotations)absltest)
html_utils)	sheets_idc                      e Zd Zd Zd Zy)HtmlUtilsTestc                |    t        j                  t        j                  d      d      }| j	                  d|       y )Nz"https://docs.google.com/?a=b#hellozhello<evil_tag/>worldurltextzk<a target="_blank" rel="noopener" href="https://docs.google.com/?a=b#hello">hello&lt;evil_tag/&gt;world</a>)r   get_anchor_tagr   	SheetsURLassertEqual)selfhtmls     v/home/www/lebenam.kofcorporation.com/venv/lib/python3.12/site-packages/google/generativeai/notebook/html_utils_test.py#test_get_anchor_tag_text_is_escapedz1HtmlUtilsTest.test_get_anchor_tag_text_is_escaped   s?    ((##$HI(
 	] 	
    c                    t        j                  d      }d|_        t        j                  |d      }| j                  d|       y )Nzhttps://docs.google.com/z%https://docs.google.com/"evil_string"zhello worldr
   zh<a target="_blank" rel="noopener" href="https://docs.google.com/&quot;evil_string&quot;">hello world</a>)r   r   _urlr   r   r   )r   r   r   s      r   "test_get_anchor_tag_url_is_escapedz0HtmlUtilsTest.test_get_anchor_tag_url_is_escaped%   sJ    !!"<=:((
 	 	
r   N)__name__
__module____qualname__r   r    r   r   r   r      s    

r   r   __main__N)__doc__
__future__r   absl.testingr   google.generativeai.notebookr   r   TestCaser   r   mainr   r   r   <module>r#      sC     " ! 3 2
H%% 
@ zHMMO r   