+
    n*j  c            
      :   R t ^ RIHt ^ RIt^ RIHu Ht ^ RI	H
t
 ^ RIHtHtHt ]
! ]4      P                   P                   R,          R,          tRRR	R
RRRRRR/tRRR	RRRRRRR/tRRR	RRRRRRR/tRRR	RRRRRRR/tR tR  tR! tR" tR# tR$ tR% tR& tR' tR# )(uL   TDD tests for compiler/stages/normalize.py — known input → known output.)annotationsN)Path)_strip_gutenbergnormalize_allnormalize_sourcefixtureshttpidmeditations-gutenberg
fetch_type	gutenberggutenberg_idix
  titlez%Meditations (George Long translation)rightszpublic-domainwikipedia-marcus-aurelius	wikipediawikipedia_titlezMarcus Aureliusu   Marcus Aurelius — Wikipediazwikiquote-marcus-aureliusurlz-https://en.wikiquote.org/wiki/Marcus_Aureliusu   Marcus Aurelius — Wikiquotezinterview-transcriptyoutubezhttps://example.com/watch?v=abczInterview Transcriptzpersonal-usec                 R   \         R ,          P                  4       p \        V 4      pRq"V9  q3'       g   \        P                  ! R	V3R
W!34      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r#Rq"V9   q3'       g   \        P                  ! RV3RW!34      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r#R# )gutenberg_2680.txtProject Gutenbergpy1py3bodyassert %(py5)spy5NMeditationsnot in)z%(py1)s not in %(py3)sinz%(py1)s in %(py3)sFIXTURES_HTTP	read_textr   
@pytest_ar_call_reprcompare	_saferepr@py_builtinslocals_should_repr_global_nameAssertionError_format_explanationrawr   @py_assert0@py_assert2@py_format4@py_format6s         F/Users/jameslopez/projects/MentorCore/tests/compiler/test_normalize.py*test_strip_gutenberg_removes_header_footerr4   /   s    //
:
:
<CC D*d**************d****d******** D     =   =      D    D            c                 R   \         R ,          P                  4       p \        V 4      pRq"V9   q3'       g   \        P                  ! R	V3R
W!34      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r#Rq"V9   q3'       g   \        P                  ! R	V3R
W!34      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r#R# )r   zgentle and meekr   r   r   r   r   Ntransformationr   r!   r"   r-   s         r3   (test_strip_gutenberg_preserves_body_textr8   6   s    //
:
:
<CC D$$$$$$$$$$$$$$$$$$$$$$$$$$$#t##############t####t########r5   c                   \         R ,          p\        V\        V R,          4      pVP                  4       pVP                  pRqT! V4      qf'       g   RRR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR	;p;rVR
qV9   q'       g   \        P                  ! RV	3RW34      R\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          p
RRV
/,          p\        \        P                  ! V4      4      hR	;rRqV9   q'       g   \        P                  ! RV	3RW34      R\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          p
RRV
/,          p\        \        P                  ! V4      4      hR	;rRqV9   q'       g   \        P                  ! RV	3RW34      R\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          p
RRV
/,          p\        \        P                  ! V4      4      hR	;rR	# )r   corpus---zLassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}py0contentpy2py4py6Nz source_id: meditations-gutenbergr   r   r   r   zrights: public-domainz1origin_url: https://www.gutenberg.org/ebooks/2680r   r!   )r#   r   GUTENBERG_SRCr$   
startswithr(   r)   r%   r*   r'   r+   r,   r&   )tmp_pathr.   destr=   @py_assert1@py_assert3@py_assert5@py_format7r/   r0   r1   r2   s   &           r3   (test_normalize_gutenberg_has_frontmatterrI   @   s   
.
.CC80CDDnnG$e$e$$$$$$$$$7$$$$7$$$$$$e$$$$$$$$$$-888888-888-888888888888888888"-g-----"---"------g----g-------->I'IIIII>III>IIIIII'IIII'IIIIIIIIr5   c                   \         R ,          p\        V\        V R,          4      pVP                  4       pRqCP	                  R^4      R	,          qTV9  qf'       gy   \
        P                  ! R
V3RWE34      R\
        P                  ! V4      R\
        P                  ! V4      /,          pRRV/,          p\        \
        P                  ! V4      4      hR;p;reR# )r   r:   r   r;   r   r?   zassert %(py6)sr@   Nr   )z%(py1)s not in %(py4)s)
r#   r   rA   r$   splitr%   r&   r'   r+   r,   )	rC   r.   rD   r=   r/   rF   r0   @py_format5rH   s	   &        r3   'test_normalize_gutenberg_no_boilerplaterN   J   s    
.
.CC80CDDnnGAmmE1&=b&AA&AAAAAAAAAAAA&AAAAAAAAAr5   c                p   \         R ,          p\        V\        V R,          4      pVP                  4       pRqDV9   qU'       g   \        P
                  ! R
V3RWC34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;rER	qDV9   qU'       g   \        P
                  ! R
V3RWC34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;rER# )wikipedia_marcus_aurelius.jsonr:   z$source_id: wikipedia-marcus-aureliusr   r   r=   r   r   NStoicr   r!   )r#   r   WIKIPEDIA_SRCr$   r%   r&   r'   r(   r)   r*   r+   r,   rC   r.   rD   r=   r/   r0   r1   r2   s   &       r3   test_normalize_wikipediarT   Q   s    
:
:CC80CDDnnG1<W<<<<<1<<<1<<<<<<W<<<<W<<<<<<<<g77ggr5   c                d   \         R ,          p\        V\        V R,          4      pVP                  4       pRqDV9   qU'       g   \        P
                  ! RV3RWC34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;rE\        V4      p^dqV8  q'       Eg   \        P
                  ! RV	3RWX34      R	R
\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MR
RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          p\        \        P                  ! V4      4      hR;p;rR# )zwikiquote_marcus_aurelius.htmlr:   z$source_id: wikiquote-marcus-aureliusr   r   r=   r   r   Nr<   lenr@   zassert %(py8)spy8r   r!   )>)z/%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} > %(py6)s)r#   r   URL_SRCr$   r%   r&   r'   r(   r)   r*   r+   r,   rV   )rC   r.   rD   r=   r/   r0   r1   r2   rG   @py_assert4rH   @py_format9s   &           r3   test_normalize_urlr\   Y   s#   
:
:CC(X*=>DnnG1<W<<<<<1<<<1<<<<<<W<<<<W<<<<<<<<w<##<33ww<#r5   c                   V R ,          pVP                  R4       \        V\        V R,          4      pVP                  4       pRqDV9   qU'       g   \        P
                  ! RV3RWC34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR	;rER
qDV9   qU'       g   \        P
                  ! RV3RWC34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR	;rERqDV9   qU'       g   \        P
                  ! RV3RWC34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR	;rERqDV9   qU'       g   \        P
                  ! RV3RWC34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR	;rER	# )zinterview-transcript.txtz3[00:00:00.000 --> 00:00:01.000] SPEAKER_00: Hello.
r:   zsource_id: interview-transcriptr   r   r=   r   r   Nzfetch_type: youtubez+origin_url: https://example.com/watch?v=abczSPEAKER_00: Hello.r   r!   )
write_textr   TRANSCRIPT_SRCr$   r%   r&   r'   r(   r)   r*   r+   r,   rS   s   &       r3   test_normalize_transcriptr`   a   s   
/
/CNNIJCH1DEDnnG,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 +G+++++ +++ ++++++G++++G++++++++8CGCCCCC8CCC8CCCCCCGCCCCGCCCCCCCC*7**************7****7********r5   c                   \         R,          p\        V\        V R,          4      pVP                  4       pVP	                  R^4      p\        V4      p^qeV8  qw'       Eg8   \        P                  ! RV3RWV34      RR\        P                  ! 4       9   g!   \        P                  ! \
        4      '       d   \        P                  ! \
        4      MRRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R	\        P                  ! V4      /,          p\        P                  ! R
4      R,           RV/,          p	\        \        P                  ! V	4      4      hR;p;rvV^,          p
RqV
9   qU'       g   \        P                  ! RV3RW34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V
4      '       d   \        P                  ! V
4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;rR# )zDResulting file must start with frontmatter and have a title heading.r   r:   r;   r<   rV   r   partsr   r@   zExpected frontmatter delimitersz
>assert %(py8)srW   Nz# body_after_fmr   r   )>=)z0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} >= %(py6)sr   r!   )r#   r   rA   r$   rL   rV   r%   r&   r(   r)   r*   r'   _format_assertmsgr+   r,   )rC   r.   rD   r=   rb   r0   rG   rZ   rH   r[   rc   r/   r1   r2   s   &             r3   !test_normalize_output_is_valid_mdrf   n   sH   
.
.CC80CDDnnGMM%#Eu:==?====:======3====3=======u====u===:================!HM =     4   4      =    =        r5   c           
        R \         R,          R\         R,          /p\        \        .p\        WV R,          4      pR qDV9   qU'       g   \        P
                  ! RV3RWC34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRR	V/,          p\        \        P                  ! V4      4      hR
;rERqDV9   qU'       g   \        P
                  ! RV3RWC34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRR	V/,          p\        \        P                  ! V4      4      hR
;rEVP                  4        EF  pVP                  q! 4       q'       g   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V	4      R\        P                  ! V
4      /,          p\        \        P                  ! V4      4      hR
;rVP                  p	RqV8H  q'       g   \        P
                  ! RV
3RW34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V	4      R	\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR
;p	;rEK  	  R
# )r	   r   r   rP   r:   r   r   resultsr   r   NzAassert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.exists
}()
}r<   pathr>   r?   z.mdzassert %(py7)spy7r   r!   )==)z.%(py2)s
{%(py2)s = %(py0)s.suffix
} == %(py5)s)r#   rA   rR   r   r%   r&   r'   r(   r)   r*   r+   r,   valuesexistssuffix)rC   	raw_pathssourcesrh   r/   r0   r1   r2   ri   rE   rF   rM   rZ   @py_format8s   &             r3   test_normalize_allrr   |   s   1E!E#]5U%UI m,GI80CDG"-g-----"---"------g----g--------&1'11111&111&111111'1111'11111111 {{{}}tt{}{{#e#e#####{######t####t###{###e######## !r5   )__doc__
__future__r   builtinsr(   _pytest.assertion.rewrite	assertionrewriter%   pathlibr   compiler.stages.normalizer   r   r   __file__parentr#   rA   rR   rY   r_   r4   r8   rI   rN   rT   r\   r`   rf   rr    r5   r3   <module>r~      s    R "     W WX%%,,z9FB 	
!+D4o 	
%+(,o 	
%%	:,o 	
 )	,#n!$JB
+!$r5   