
    -Ph;'                         d dl Z d dlmZ d dlmZ d dlmZ d dlmZ ddl	m
Z
mZ ddlmZ dd	lmZ d
dlmZmZ  G d de          ZdS )    N)Path)dedent)	CliRunner)TestCase   )render_fragmentssplit_fragments)append_to_newsfile)_main   )read_pkg_resourcewritec                   0    e Zd ZdZd Zd Zd Zd Zd ZdS )WritingTestsNc                    dddddddi ddid}d	d
ddd
ddddd}d}|                                  }t          j        |           t          t          j                            |d          d          5 }|                    d           d d d            n# 1 swxY w Y   t          ||          }t          d          }t          |dddt          |d ||ddgd
dddd          d
           t          t          j                            |d                    5 }|                                }d d d            n# 1 swxY w Y   |                     ||           d S )N Stuff!zSecond Stuff!
Foo added.)142miscr   1r   r   4featurer   )r   r   r   2r   r   72r   r   3bugfixr   
Web fixed.r   NamesWebFeaturesTnameshowcontentBugfixesMiscFr   r#   r   zMyProject 1.0 (never)
=====================

Features
--------

- Foo added. (#2, #72)
- Stuff! (#4)
- Second Stuff! (#4)


Misc
----

- #1, #142


Names
-----

No significant changes.


Web
---

Bugfixes
~~~~~~~~

- Web fixed. (#3)


Old text.
NEWS.rstwz
Old text.
templates/default.rst!.. towncrier release notes start
-~	MyProject1.0neverr*   versiondatewrapversiondatasingle_file)mktemposmakedirsopenpathjoinr   r	   r   r
   r   readassertEqual)self	fragmentsdefinitionsexpected_outputtempdirftemplateoutputs           Y/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/towncrier/test/test_write.pytest_append_at_topzWritingTests.test_append_at_top   s,    %'"$%-%4%1&2  &5
 
	 !+4@@)$??#E::
 
!F ++--
G"',,w
33S99 	#QGGM"""	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# $I{;;	$%<==0c
%0UGTT   	
 	
 	
 	
" "',,w
3344 	VVXXF	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	&11111s$   7BB BE  EEc                 H   dddddddi ddid}d	d
ddd
ddddd}d}|                                  }t          t          j                            |d          dd
           t          ||          }t          d          }t          |dddt          |d||ddgd
dddd          d
           t          t          j                            |d                    5 }|
                                }ddd           n# 1 swxY w Y   |                     ||           dS )z
        If there is a comment with C{.. towncrier release notes start},
        towncrier will add the version notes after it.
        r   r   r   a  Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! )r   r   r   r   r   )99r   r   r!   r$   r%   r(   Tr)   r,   r-   Fr.   a+  Hello there! Here is some info.

.. towncrier release notes start

MyProject 1.0 (never)
=====================

Features
--------

- Foo added. (#2, #72)
- Stuff! (#4)
- Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo!
  Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo!
  Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo!
  Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo!
  Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo!
  Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo!
  Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! Foo! (#99)


Misc
----

- #1, #142


Names
-----

No significant changes.


Web
---

Bugfixes
~~~~~~~~

- Web fixed. (#3)


Old text.
r/   z                Hello there! Here is some info.

                .. towncrier release notes start
                Old text.
            )contentsr   r1   r2   Nr3   r4   r5   r6   r7   r8   r;   r>   )r@   r   rA   rD   rE   r	   r   r
   r   rC   rF   rG   )rH   rI   rJ   rK   rL   rN   rM   rO   s           rP   test_append_at_top_with_hintz)WritingTests.test_append_at_top_with_hintl   s    %'"$%-%1&2&3  &5
 
	 !+4@@)$??#E::
 
+Z ++--GLL*-- 		
 		
 		
 		
 $I{;;	$%<==0c
%0UGTT   	
 	
 	
 	
" "',,w
3344 	VVXXF	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	&11111s    DDDc                    |                                  }t          j        |           i }t          i |          }t	          d          }t          |d||ddgdddd	d
          }t          |ddd|d           t          t          j        	                    |d                    5 }|
                                }ddd           n# 1 swxY w Y   t          d          }|                     ||           dS )zu
        When no `start_string` is defined, the generated content is added at
        the start of the file.
        )rI   rJ   r1   Nr3   r4   Tr5   r6   r7   r8   )rN   issue_formatrI   rJ   
underlinesr<   r=   r/   r   )	directoryfilenamestart_stringtop_linecontentr?   zL            MyProject 1.0 (never)
            =====================
        )r@   rA   rB   r	   r   r   r
   rC   rD   rE   rF   r   rG   )	rH   rL   rJ   rI   rN   r]   rM   rO   rK   s	            rP   "test_multiple_file_no_start_stringz/WritingTests.test_multiple_file_no_start_string   s[   
 ++--
G#bkJJJ	$%<=="#Sz!,PP
 
 
 		
 	
 	
 	
 "',,w
3344 	VVXXF	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 !
 
 	&11111s   )C

CCc                    t                      fd}                                5  t          dd          5 }|                    t	          d                                                     ddd           n# 1 swxY w Y   t          dd          5 }|                    d           ddd           n# 1 swxY w Y   t          j        d            |            }|                     d	|j	                    |            }| 
                    d	|j	                   |                     |j        t                     |                     d
|j        j        d	                    ddd           dS # 1 swxY w Y   dS )z
        When `single_file` enabled as default,
        and fragments of `version` already produced in the newsfile,
        a duplicate `build` will throw a ValueError.
        c                      t          dd          5 } |                     d           d d d            n# 1 swxY w Y                       t          g d          }|S Nznewsfragments/123.featurer0   zAdds levitation)z	--versionz7.8.9z--namefooz--datez
01-01-2001z--yesrC   r   invoker   rM   resultrunners     rP   do_build_oncezRWritingTests.test_with_title_format_duplicate_version_raise.<locals>.do_build_once      1377 +1)***+ + + + + + + + + + + + + + + ]]   F M   488pyproject.tomlr0   z
                    [tool.towncrier]
                    title_format="{name} {version} ({project_date})"
                    filename="{version}-notes.rst"
                    Nz{version}-notes.rstz0Release Notes

.. towncrier release notes start
newsfragmentsr   z+already produced newsfiles for this version)r   isolated_filesystemrC   r   r   lstriprA   mkdirrG   	exit_codeassertNotEqualassertIsInstance	exception
ValueErrorassertSubstringargs)rH   rh   rM   rf   rg   s       @rP   .test_with_title_format_duplicate_version_raisez;WritingTests.test_with_title_format_duplicate_version_raise  sW    	 	 	 	 	& '')) 	 	&,, 	  fhh  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 +S11 OQMNNNO O O O O O O O O O O O O O OH_%%%"]__FQ 0111"]__F6#3444!!&"2J???  =v?O?TUV?W  +	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	sY   E45A;/E4;A?	?E4A?	E4B8,E48B<	<E4?B<	 B'E44E8;E8c                    t                      fd}                                5  t          dd          5 }|                    t	          d                                                     ddd           n# 1 swxY w Y   t          j        d            |            }|                     d|j	                    |            }|                     d|j	                   t          t          j                                        d                    }|                     d	t          |                     |                     d
|d         j                   t          |d                   5 }|                                }ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y   t	          d          }|                     ||           dS )z
        When `single_file` disabled, multiple newsfiles generated and
        the content of which get overwritten each time.
        c                      t          dd          5 } |                     d           d d d            n# 1 swxY w Y                       t          g d          }|S ra   rc   re   s     rP   rh   zVWritingTests.test_single_file_false_overwrite_duplicate_version.<locals>.do_build_once>  ri   rj   rk   r0   z
                    [tool.towncrier]
                    single_file=false
                    title_format="{name} {version} ({project_date})"
                    filename="{version}-notes.rst"
                    Nrl   r   z*-notes.rstr   z7.8.9-notes.rstz            foo 7.8.9 (01-01-2001)
            ======================

            Features
            --------

            - Adds levitation (#123)
            )r   rm   rC   r   r   rn   rA   ro   rG   rp   listr   cwdgloblenr*   rF   )rH   rh   rM   rf   notesrO   rK   rg   s          @rP   2test_single_file_false_overwrite_duplicate_versionz?WritingTests.test_single_file_false_overwrite_duplicate_version7  s{   
 	 	 	 	 	& '')) 	" 	"&,, 
  fhh	 	 	
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 H_%%%"]__FQ 0111"]__FQ 01117788EQE

+++.a>>>eAh "1" " " " " " " " " " " " " " "1	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"6 !

 

 	&11111sY   F(5A;/F(;A?	?F(A?	C-F(0FF(F	F(F	F((F,/F,)	__name__
__module____qualname__maxDiffrQ   rU   r^   rw   r        rP   r   r      ss        GU2 U2 U2ni2 i2 i2V*2 *2 *2X2 2 2hA2 A2 A2 A2 A2r   r   )rA   pathlibr   textwrapr   click.testingr   twisted.trial.unittestr   _builderr   r	   _writerr
   buildr   helpersr   r   r   r   r   rP   <module>r      s    
			             # # # # # # + + + + + + 8 8 8 8 8 8 8 8 ( ( ( ( ( (       - - - - - - - -f2 f2 f2 f2 f28 f2 f2 f2 f2 f2r   