
    dxH              
       0   d dl Zd dlmc mZ d dlZd dlZd dlZd dl	Z	d dl
Z
d dlZd dlmZ d Z G d d edg dg d                    Z G d	 d
 ed
g ddg                    ZdddZ G d d          Z G d d          Z	 dej        ddddZdeddddZedk    ra e            Zej        dk    r eej        ej                   n4ej        dk    r) eej        ej        ej        ej        ej                    G d d          ZdS )    N)
namedtuplec            
      H   t          j        d          }d|_        |                    dd          }|                    dd	          }|                    d
d	          }|                    ddd           |                    dddddg dd           |                    ddd           |                    ddd           |                    ddt          dd           |                    dd d!d"#           |                    d$dd%&            |j        | i |S )'NzMNeoMutt helper to turn text/markdown email parts into full-fledged MIME trees)descriptionuX   Copyright © 2022 martin f. krafft <madduck@madduck.net>.
Released under the MIT licencezSub-command parsersmode)helpdestsetupzSetup phase)r   massagezMassaging phasez--debug-commands
store_truez5Turn on debug logging of commands generated to stderr)actionr   z--extensionz-x	EXTENSION
extensions?appendz7Markdown extension to add to the list of extensions use)metavarr   nargsdefaultr   r   z--debug-walkz1Turn on debugging to stderr of the MIME tree walkz--extensions
EXTENSIONS z0Markdown extension to use (comma-separated list))r   typer   r   z--write-commands-toPATHcmdpathz(Temporary file path to write commands to)r   r   r   	MAILDRAFTz>If provided, the script is invoked as editor on the mail draft)r   r   )argparseArgumentParserepilogadd_subparsers
add_parseradd_argumentstr
parse_args)argskwargsparsersubpparser_setupparser_massages         ./home/madduck/.config/neomutt/buildmimetree.pyparse_cli_argsr)   *   s   $+  F	) M
   &;& IID??7???L__Y5F_GGND     F  	 	 	 D      @      ?      7	      M      6d-f---    c                       e Zd Zd ZdS )Partc                 j    d| j          d| j         d}| j        r| d| j         }| j        r| d}|S )N</>z cid:z	 ORIGINAL)r   subtypecidorig)selfrets     r(   __str__zPart.__str__y   sZ    -$)--dl---8 	*))tx))C9 	$###C
r*   N__name__
__module____qualname__r6    r*   r(   r,   r,   r   s#            r*   r,   )r   r1   pathdescr2   r3   )NNF)defaultsc                       e Zd Zd ZdS )	Multipartc                 @    d| j          dt          | j                   S )Nz<multipart/z> children=)r1   lenchildrenr4   s    r(   r6   zMultipart.__str__   s$    JT\JJc$-6H6HJJJr*   Nr7   r;   r*   r(   r@   r@      s(        K K K K Kr*   r@   )r1   rC   r=   r   c                ^   t          j        |           }t          dd|dd          }t          |dd          5 }|                                }d d d            n# 1 swxY w Y   t          j        |	          }|                    |          }|                    d
          }t          dd|d          }	t          |ddd          5 }
|
	                    |           d d d            n# 1 swxY w Y   t          ddddd          }t          dt          d||	gd          |gd          S )NtextplainzPlain-text versionT)r3   rzutf-8)encodingrE   z.htmlhtmlzHTML versionwxmlcharrefreplace)rJ   errorsimagepngz+/usr/share/doc/neomutt/logo/neomutt-256.pngLogozneomutt-256.pngrelativealternativezGroup of alternative contentzGroup of related content)pathlibPathr,   openreadmarkdownMarkdownconvertwith_suffixwriter@   )	maildraftr   	draftpathtextparttextmarkdownrG   mdwnrK   htmlpathhtmlparttexthtmllogoparts               r(   convert_markdown_to_htmlrf      s   Y''I$8t  H 
iw	/	/	/ #<  ""# # # # # # # # # # # # # # # 
333D<<D$$W--HFFHn==H	#0C
 
 
 	t              
 5 H 8$. 
 	
 	#  s#   AA #A C--C14C1c                   4    e Zd ZddddZdddZd Zd ZdS )	MIMETreeDFWalkerNF)
visitor_fndebugc                "    || _         || _        d S N)_visitor_fn_debug)r4   ri   rj   s      r(   __init__zMIMETreeDFWalker.__init__   s    %r*   ri   c                    t          |t                    rt          d|          }|                     |g |p| j                   dS )zo
        Recursive function to implement a depth-dirst walk of the MIME-tree
        rooted at `root`.
        mixed)rC   stackri   N)
isinstancelistr@   _walkrm   )r4   rootri   s      r(   walkzMIMETreeDFWalker.walk   s^     dD!! 	5Wt444D

!5T%5 	 	
 	
 	
 	
 	
r*   c                    dt          |          z   d}t          |t                    r|                     | | dd |D                         |                    |           |                     dt          |          dz   z             |j        D ]}|                     |||           |                     dt          |          z             |j        } |            }||k    }|st          j	        d|fd||f          d	t          j                    v st          j        |          rt          j        |          nd	t          j        |          t          j        |          d
t          j                    v st          j        |          rt          j        |          nd
dz  }	dd|	iz  }
t          t          j        |
                    d x}x}}n|                     | |            |r |||| j                   d S d S )Nz| z|-z	 parents=c                     g | ]	}|j         
S r;   )r1   ).0ss     r(   
<listcomp>z*MIMETreeDFWalker._walk.<locals>.<listcomp>   s    (B(B(Bq(B(B(Br*      rs   ==)zB%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.pop
}()
} == %(py6)srt   node)py0py2py4py6assert %(py8)spy8
debugprint)rB   ru   r@   r   r   rC   rw   pop
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanation)r4   r   rt   ri   leadchild@py_assert1@py_assert3@py_assert5@py_format7@py_format9s              r(   rw   zMIMETreeDFWalker._walk   sv    s5zz/%%%dI&& 	-OODDD(B(BE(B(B(BDD   LLOODCJJN3444  

)     
 OOD3u::-...&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OOtOTOO,,, 	@JtUt??????	@ 	@r*   c                 J    | j         rt          |fdt          j        i| d S d S Nfilern   printsysstderrr4   r}   r#   s      r(   r   zMIMETreeDFWalker.debugprint   9    ; 	0!//#*//////	0 	0r*   )r8   r9   r:   ro   ry   rw   r   r;   r*   r(   rh   rh      sr        %)      (, 
 
 
 
 
@ @ @B0 0 0 0 0r*   rh   c                   D    e Zd ZdZej        fdddZd Zd Zd Z	d Z
d	S )
MuttCommandsaK  
    Stupid class to interface writing out Mutt commands. This is quite a hack
    to deal with the fact that Mutt runs "push" commands in reverse order, so
    all of a sudden, things become very complicated when mixing with "real"
    commands.

    Hence we keep two sets of commands, and one set of pushes. Commands are
    added to the first until a push is added, after which commands are added to
    the second set of commands.

    On flush(), the first set is printed, followed by the pushes in reverse,
    and then the second set is printed. All 3 sets are then cleared.
    Frj   c                N    g g g c| _         | _        | _        || _        || _        d S rl   )_cmd1_push_cmd2_out_frn   )r4   out_frj   s      r(   ro   zMuttCommands.__init__   s*    -/R*
DJ
r*   c                     |                      |           | j        r| j                            |           d S | j                            |           d S rl   )r   r   r   r   r   r4   r}   s     r(   cmdzMuttCommands.cmd  sV    : 	!Ja     Ja     r*   c                     |                     dd          }d| d}|                     |           | j                            d|           d S )N"zpush "r   )replacer   r   insertr   s     r(   pushzMuttCommands.push  sR    IIc3QMMM
!Qr*   c                     t          d                    | j        | j        z   | j        z             | j                   g g g c| _        | _        | _        d S )N
)r   )r   joinr   r   r   r   rD   s    r(   flushzMuttCommands.flush  sX    IIdj4:-
:;;$+	
 	
 	
 	
 .0R*
DJ


r*   c                 J    | j         rt          |fdt          j        i| d S d S r   r   r   s      r(   r   zMuttCommands.debugprint  r   r*   N)r8   r9   r:   __doc__r   stdoutro   r   r   r   r   r;   r*   r(   r   r      s          !Z %     
! ! !     8 8 80 0 0 0 0r*   r   F)r   temppathdebug_commandsc                &   | pg } |p,t          j        t          j        d          d                   }t	          ||          }t
          j        d          d| }| r| dd                    |            }|                    d	           |                    d
           |                    d| d           |                    d           |                    d|            |	                    d           |
                                 d S )Nz	muttmdwn-)prefixr   r   r   z massage --write-commands-to z --extensions ,zset my_editor="$editor"z#set my_edit_headers="$edit_headers"zset editor="r   zunset edit_headersz!set my_mdwn_postprocess_cmd_file=z<first-entry><edit-file>)rT   rU   tempfilemkstempr   r   argvr   r   r   r   )r   r   r   r   cmdseditors         r(   do_setupr     s'    !rJ 7<,,,Q/ H ^444DDD(DDF A@@#((:*>*>@@HH&'''HH2333HH%F%%%&&&HH!"""HH;;;<<<II()))JJLLLLLr*   )r   	converterr   
debug_walkc                  
 t          |d          5 }t          ||          

                    d           
                    d           
                    d           
                    d           
                                 |r|                    d          ng } || |          }t          t          j                  }d d	
fd

}	|                    ||	           
                    dt          j	         d           
                    d           
                                 d d d            d S # 1 swxY w Y   d S )NrL   r   zset editor="$my_editor"z#set edit_headers="$my_edit_headers"zunset my_editorzunset my_edit_headersr   rE   r   c                `   t          | t                    r| j        sX                    d| j         d                               d           | j        r                    d| j         d           | j        r                    d| j         d                               d           dS t          | t                    r| j        dk    r                    d           nA| j        d	k    r                    d
           n | j        dk    r                    d           | j        r                    d| j         d           |r                    d           dS dS d}| }|s:ddt          j
        |          iz  }t          t          j        |                    dx}}dS )z
            Visitor function called for every node (part) of the MIME tree,
            depth-first, and responsible for telling NeoMutt how to assemble
            the tree.
            z<attach-file>z<enter>z#<toggle-unlink><toggle-disposition>z<edit-content-id>\Ca\Ckz<edit-description>\Ca\Ckz<tag-entry>rS   z<group-alternatives>rR   z<group-related>multilingualz<group-multilingual>zis valid partzassert not %(py1)spy1N)ru   r,   r3   r   r<   r2   r=   r@   r1   r   r   r   r   )itemrt   r   @py_assert0@py_assert2@py_format3r   s         r(   ri   zdo_massage.<locals>.visitor_fnS  s    $%% 1+ y II@di@@@AAAIICDDDx 		IIII   9 OIIM49MMMNNN
 		-(((((D),, +
 <=00II45555\Z//II/0000\^33II4555 9 OIIM49MMMNNN
  -IIm,,,,,- -
 +*******************************r*   rp   zsource 'rm -f z|'z"unset my_mdwn_postprocess_cmd_file)
rV   r   r   r   splitrh   r"   r   ry   r   )r]   r   r   r   r   r   cmd_ftreemimetreeri   r   s             @r(   
do_massager   2  s    
gs		 Xu
 E888*+++6777"###())) 	

.8@Z%%c***b
yz:::#$/:::26 7	+ 7	+ 7	+ 7	+ 7	+ 7	+ 7	+| 	dz222 	2$,2223335666

qX X X X X X X X X X X X X X X X X Xs   D%EEE__main__r	   )r   r
   )r   r   r   c                       e Zd Zej        d             Zej        d             Zd Zd Zd Z	ej        d             Z
d Zd Zd	 Zd
 Zd ZdS )Testsc                     dS )NzCONSTANT STRING 1r;   rD   s    r(   const1zTests.const1      ""r*   c                     dS )NzCONSTANT STRING 2r;   rD   s    r(   const2zTests.const2  r   r*   c           	         t          t          j                  }|                    |           |                    |           |                                 |                                }|j        }d}|j        }||df}	 ||	          }
||
k    }|st          j	        d|fd||
f          dt          j                    v st          j        |          rt          j        |          ndt          j        |          t          j        |          t          j        |          t          j        |	          t          j        |
          dz  }dd	|iz  }t          t          j        |                    d
x}x}x}x}x}	}
d
S )zAssert order of commandsr   r   r   r   )ze%(py2)s
{%(py2)s = %(py0)s.out
} == %(py11)s
{%(py11)s = %(py7)s
{%(py7)s = %(py5)s.join
}(%(py9)s)
}captured)r   r   py5py7py9py11zassert %(py13)spy13N)r   r   r   r   r   
readouterroutr   r   r   r   r   r   r   r   r   )r4   r   r   capsysr   r   r   @py_assert4@py_assert6@py_assert8@py_assert10r   @py_format12@py_format14s                 r(   test_MuttCommands_cmdzTests.test_MuttCommands_cmd  s   #*---

$$&&>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>r*   c                    t          t          j                  }|                    |           |                    |           |                                 |                                }|j        }d                    d||df          dd         }||k    }|st          j	        d|fd||f          dt          j                    v st          j        |          rt          j        |          ndt          j        |          t          j        |          d	z  }	d
d|	iz  }
t          t          j        |
                    dx}x}}dS )Assert reverse order of pushesr   z"
push "r      ir   )z+%(py2)s
{%(py2)s = %(py0)s.out
} == %(py5)sr   )r   r   r   zassert %(py7)sr   N)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r4   r   r   r   r   r   r   r   r   @py_format6@py_format8s              r(   test_MuttCommands_pushzTests.test_MuttCommands_push  s   #*---		&		&

$$&&	
		
 	
	T	
 	
 	
 	
 	
	T	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
		
 	
 	
 	
 	
	
 	
 	
 	
 	
 		
 	
 	
 	
 	
 	
 		
 	
 	
 	
 		
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
r*   c                 p
   t          t          j                  }g d}t          d          D ]}|                    |d|z  dz                       |                    |d|z  dz                       |                    |d|z  dz                       |                    |d|z  dz                       |                                 |                                }|j        	                                }|d         }	|d         }
|	|
v }|slt          j        d|fd	|	|
f          t          j        |	          t          j        |
          d
z  }dd|iz  }t          t          j        |                    dx}	x}}
|d         }	|d         }
|	|
v }|slt          j        d|fd	|	|
f          t          j        |	          t          j        |
          d
z  }dd|iz  }t          t          j        |                    dx}	x}}
|d         }	|d         }
|	|
v }|slt          j        d|fd	|	|
f          t          j        |	          t          j        |
          d
z  }dd|iz  }t          t          j        |                    dx}	x}}
|d         }	|d         }
|	|
v }|slt          j        d|fd	|	|
f          t          j        |	          t          j        |
          d
z  }dd|iz  }t          t          j        |                    dx}	x}}
|d         }	|d         }
|	|
v }|slt          j        d|fd	|	|
f          t          j        |	          t          j        |
          d
z  }dd|iz  }t          t          j        |                    dx}	x}}
|d         }	|d         }
|	|
v }|slt          j        d|fd	|	|
f          t          j        |	          t          j        |
          d
z  }dd|iz  }t          t          j        |                    dx}	x}}
|d         }	|d         }
|	|
v }|slt          j        d|fd	|	|
f          t          j        |	          t          j        |
          d
z  }dd|iz  }t          t          j        |                    dx}	x}}
|d         }	|d         }
|	|
v }|slt          j        d|fd	|	|
f          t          j        |	          t          j        |
          d
z  }dd|iz  }t          t          j        |                    dx}	x}}
dS )r   r   )000001010011100101110111r      r   r      inz%(py1)s in %(py4)sr   r   assert %(py6)sr   N         )r   r   r   ranger   r   r   r   r   
splitlinesr   r   r   r   r   )r4   r   r   r   r   linesir   	lines_outr   r   r   @py_format5r   s                 r(    test_MuttCommands_cmd_push_mixedz&Tests.test_MuttCommands_cmd_push_mixed  s   #*---HHHq 	( 	(AHHU1q519%&&&HHU1q519%&&&IIeAEAI&'''IIeAEAI&''''

$$&&L++--	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''r*   c                     t          dt          dt          dddd          t          ddd	d
          gd          t          ddddd          gd          S )NrelatedrS   rG   rH   zpart.txtPlain)r=   rK   z	part.htmlHTMLAlternative)rC   r=   rP   zlogo.pngrQ   )r2   r=   Related)r@   r,   rD   s    r(   basic_mime_treezTests.basic_mime_tree  s    !VWjwGGGVV[vFFF '   VUJJVLLL
 
 
 
 	
r*   c                 b   t                      }g fd}|                    ||           t                    }d}||k    }|st          j        d|fd||f          dt          j                    v st          j        t                    rt          j        t                    nddt          j                    v st          j                  rt          j                  ndt          j        |          t          j        |          dz  }d	d
|iz  }t          t          j
        |                    d x}x}}d         d         }	|	j        }d}||k    }|st          j        d|fd||f          t          j        |	          t          j        |          t          j        |          dz  }d	d
|iz  }t          t          j
        |                    d x}	x}x}}d         d         }	d}
|	|
k    }|slt          j        d|fd|	|
f          t          j        |	          t          j        |
          dz  }dd|iz  }t          t          j
        |                    d x}	x}}
d         d         }	|	j        }d}||k    }|st          j        d|fd||f          t          j        |	          t          j        |          t          j        |          dz  }d	d
|iz  }t          t          j
        |                    d x}	x}x}}d         d         }	d}
|	|
k    }|slt          j        d|fd|	|
f          t          j        |	          t          j        |
          dz  }dd|iz  }t          t          j
        |                    d x}	x}}
d         d         }	|	j        }d}||k    }|st          j        d|fd||f          t          j        |	          t          j        |          t          j        |          dz  }d	d
|iz  }t          t          j
        |                    d x}	x}x}}d         d         }	d}
|	|
k    }|slt          j        d|fd|	|
f          t          j        |	          t          j        |
          dz  }dd|iz  }t          t          j
        |                    d x}	x}}
d         d         }	|	j        }d}||k    }|st          j        d|fd||f          t          j        |	          t          j        |          t          j        |          dz  }d	d
|iz  }t          t          j
        |                    d x}	x}x}}d         d         }	d}
|	|
k    }|slt          j        d|fd|	|
f          t          j        |	          t          j        |
          dz  }dd|iz  }t          t          j
        |                    d x}	x}}
d         d         }	|	j        }d}||k    }|st          j        d|fd||f          t          j        |	          t          j        |          t          j        |          dz  }d	d
|iz  }t          t          j
        |                    d x}	x}x}}d         d         }	d}
|	|
k    }|slt          j        d|fd|	|
f          t          j        |	          t          j        |
          dz  }dd|iz  }t          t          j
        |                    d x}	x}}
d S )Nc                 P                         | t          |          f           d S rl   )r   rB   r   rt   r   itemss      r(   ri   z@Tests.test_MIMETreeDFWalker_depth_first_walk.<locals>.visitor_fn  s&    LL$E

+,,,,,r*   rp   r  r   z0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)srB   r  r   r   py3r   r   r   r   rH   z/%(py3)s
{%(py3)s = %(py1)s.subtype
} == %(py6)sr   r  r   r   r   )z%(py1)s == %(py4)sr  r  r   rK   rS   r   rP   r   r  )rh   ry   rB   r   r   r   r   r   r   r   r   r1   )r4   r  r   ri   r   r   r   r   r   r   r   r  r  s               @r(   &test_MIMETreeDFWalker_depth_first_walkz,Tests.test_MIMETreeDFWalker_depth_first_walk  s	   #%%	- 	- 	- 	- 	- 	o*===----------------------------------------------------------------------,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3333333333333333333333333333333333333333333333333333333333333333333333++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//////////////////////////////////////////////////////////////////////r*   c                   
 t                      }g 

fd}|                    |g|           
d         }|j        }d}||k    }|st          j        d|fd||f          t          j        |          t          j        |          t          j        |          dz  }dd	|iz  }	t          t          j        |	                    d x}x}x}}d S )
Nc                 2                         |            d S rl   r   r  s      r(   ri   z=Tests.test_MIMETreeDFWalker_list_to_mixed.<locals>.visitor_fn      LLr*   rp   rr   r   r  r  r   r   )rh   ry   r1   r   r   r   r   r   )r4   r  r   ri   r   r   r   r   r   r   r  s             @r(   #test_MIMETreeDFWalker_list_to_mixedz)Tests.test_MIMETreeDFWalker_list_to_mixed  s   #%%	 	 	 	 	 	'J???++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++r*   c                   	 g 		fd}t          |          }|                    |           t          	          }d}||k    }|st          j        d|fd||f          dt          j                    v st          j        t                    rt          j        t                    nddt          j                    v st          j        	          rt          j        	          ndt          j        |          t          j        |          dz  }d	d
|iz  }t          t          j
        |                    d x}x}}d S )Nc                 2                         |            d S rl   r#  r  s      r(   ri   zFTests.test_MIMETreeDFWalker_visitor_in_constructor.<locals>.visitor_fn  r$  r*   rp   r  r   r  rB   r  r  r   r   )rh   ry   rB   r   r   r   r   r   r   r   r   )
r4   r  ri   r   r   r   r   r   r   r  s
            @r(   ,test_MIMETreeDFWalker_visitor_in_constructorz2Tests.test_MIMETreeDFWalker_visitor_in_constructor  st   	 	 	 	 	 $z:::o&&&r*   c                 V   t          |t          j                   |                                }|j                                        }|d         }|j        }| d} ||          }|ssdt          j        |          t          j        |          t          j        |          t          j        |          dz  }	t          t          j
        |	                    dx}x}x}}|d         }|j        } ||          }
|
sdt          j        |          t          j        |          d	t          j                    v st          j        |          rt          j        |          nd	t          j        |
          d
z  }t          t          j
        |                    dx}x}}
d}|d         }||v }|slt          j        d|fd||f          t          j        |          t          j        |          dz  }dd|iz  }t          t          j
        |                    dx}x}}d}|d         }||v }|slt          j        d|fd||f          t          j        |          t          j        |          dz  }dd|iz  }t          t          j
        |                    dx}x}}dS )z,Assert basics about the setup command output)r   r   r   r   Jassert %(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.endswith
}(%(py5)s)
}r   r  r   r   Nr   Jassert %(py6)s
{%(py6)s = %(py3)s
{%(py3)s = %(py1)s.endswith
}(%(py4)s)
}r   r   r  r   r   zfirst-entryr%  r  r  r  r  r   z	edit-file)r   r   r   r   r   r
  endswithr   r   r   r   r   r   r   r   )r4   r   r   captoutr  r   r   r   r   r   r   r   r   r  s                 r(   test_do_setup_no_extensionsz!Tests.test_do_setup_no_extensions!  s)   &
3333##%%&&((..............................................................(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))))''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''r*   c                 Z   t          |||gt          j                   |                                }|j                                        }|d         }|j        }| d| d} ||          }	|	ssdt          j        |          t          j        |          t          j        |          t          j        |	          dz  }
t          t          j
        |
                    dx}x}x}}	|d         }|j        } ||          }|sd	t          j        |          t          j        |          d
t          j                    v st          j        |          rt          j        |          nd
t          j        |          dz  }t          t          j
        |                    dx}x}}dS )z+Assert that extensions are passed to editor)r   r   r   r   r   r   r+  r,  Nr   r-  r   r.  )r   r   r   r   r   r
  r/  r   r   r   r   r   r   r   )r4   r   r   r   r0  r  r   r   r   r   r   r   r   s                r(   test_do_setup_extensionszTests.test_do_setup_extensions+  s   (8
	
 	
 	
 	
 ##%%&&((77777777777777777777777777777777777777777777777777777777777777777((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((r*   N)r8   r9   r:   pytestfixturer   r   r   r   r  r  r   r&  r)  r1  r3  r;   r*   r(   r   r     s        ^# # ^# ^# # ^#? ? ?	
 	
 	
( ( (, ^
 
 ^
"     *	, 	, 	,  ( ( (	) 	) 	) 	) 	)r*   r   rl   ) builtinsr   _pytest.assertion.rewrite	assertionrewriter   r   rT   rX   r   r   r4  collectionsr   r)   r,   r@   rf   rh   r   r   r   r   r8   r"   r   r   r   r   r   r   r   r;   r*   r(   <module>r;     s  B             



      " " " " " "B. B. B.P    J:::$$$     K K K K KJ{;;;tfMMMK K K 7; ' ' ' ' 'T70 70 70 70 70 70 70 70z)0 )0 )0 )0 )0 )0 )0 )0Z !j4    4 &e e e e eT z>DyG1DEEEEE	i		
NL.	
 	
 	
 	
E) E) E) E) E) E) E) E) E) E)r*   