o
    i                     @   sb   d dl Z d dlmZ d dlmZ ddlmZ e de dZdd	 Z	d
d Z
G dd deZdS )    N)
path_regex)url_path_join   )NotebookTestBasez^/x$c                  C   s   dD ]
} t t| sJ qd S )N)z/xz/x/z/x/fooz/x/foo.ipynbz
/x/foo/barz/x/foo/bar.txtrematchpath_patpath r   T/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/notebook/tests/test_paths.pytest_path_regex   s   r   c                  C   s   dD ]
} t t| rJ qd S )N)z/xfooz/xfoo/z	/xfoo/barz
/xfoo/bar/z/x/foo/bar/z/x//fooz/yz/y/x/foor   r   r   r   r   test_path_regex_bad   s   
r   c                   @   s   e Zd Zdd ZdS )RedirectTestCasec                 C   sb   dD ],\}}| j d|dd}t|| |jdksJ d|jv s!J |jd t| j|ks.J qd S )N))z/notebooks/mynotebook/z/notebooks/mynotebook)z
////foo///z/foo)z//example.com/z/example.com)z/has/param/?hasparam=truez/has/param?hasparam=trueGETF)allow_redirectsi.  Location)requestprintstatus_codeheadersr   
url_prefix)selfuriexpectedrr   r   r   test_trailing_slash%   s   
z$RedirectTestCase.test_trailing_slashN)__name__
__module____qualname__r   r   r   r   r   r   $   s    r   )r   notebook.base.handlersr   notebook.utilsr   launchnotebookr   compiler
   r   r   r   r   r   r   r   <module>   s    