
    3jk                    (   d Z ddlmZ ddlZ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
 dd	lmZ dd
lmZ ddlmZmZmZmZmZmZmZ  G d dej,                        Z G d dej,                        Zedk(  rddlZ ej4                  e       yy)a&  
Tests for :mod:`music21.humdrum.spineParser`.

The tests live in this companion module rather than at the bottom of
spineParser.py because spineParser is large; only the testCopyAndDeepcopy
test stays in spineParser so its `globals()` picks up the parser classes
for the deep-copy round trip.
    )annotationsN)bar)common)dynamics)expressions)roman)stream)	testFiles)HumdrumDataCollection	KernSpineSpineComment
SpineEventflavorshdStringToMeasurekernTandemToObjectc                     e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Z ej(                  d      d        Z ej(                  d      d        Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)Testc                "   t        t        j                        }|j                          |j                  j                  d      }| j                  |j                  d       | j                  |j                  j                  d       |j                  j                  d      }|j                  D cg c]  }|j                   }}| j                  |g d       | j                  |j                  d       | j                  |t               y c c}w )N      )r      	   
                            #   $   '   (   kern)r   r
   mazurka6parsespineCollectiongetSpineByIdassertEqualidparentSpinechildSpines	spineTypeassertIsInstancer   )selfhf1spine5spine1csspine1Childrens         B/DATA/.local/lib/python3.12/site-packages/music21/humdrum/tests.pytestLoadMazurkazTest.testLoadMazurka*   s     $I$6$67		$ $$11!4A&++..2$$11!4*0*<*<=*<B"%%*<=V	X 	))62fi0 >s   0Dc                `   t        d      }|j                         }| j                  |j                  j                  j
                  d       | j                  |j                  j                  d       | j                  |j                  j                  d   j                  j                  d       y )Nz40..ccccc##_wtLLK~v/zdouble-sharpr      )
r   toNoter+   pitch
accidentalnamedurationdotstupletsdurationNormal)r1   abs      r7   testSingleNotezTest.testSingleNoteL   s{    -.HHJ++00.A!,++A.==BBAF    c                   t        j                         }t        d|      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  t        j                         | j                  |j                  j                  d       | j                  |j                  j                  d       | j                  |j                  j                  t        j                         | j                  |j                  t        j                         | j                  |j                  j                  d       | j                  |j                  j                  d       y )Nz=29a;:|:   rC   endregularstart)r	   Measurer   r+   numbernumberSuffixr0   rightBarliner   Repeat	directiontypepauser   FermataleftBarline)r1   m0m1s      r7   testMeasureBoundarieszTest.testMeasureBoundariesT   s    ^^z2.B'#.booszz:22E:--y9boo33[5H5HIbnncjj9117;,,i8rF   c                4   t        d      }| j                  t        |      d       t        d      }| j                  t        |      d       t        d      }| j                  t        |      d       t        d      }| j                  t        |      d       y )	Nz*M3/1z!<music21.meter.TimeSignature 3/1>z*M3/0z!<music21.meter.TimeSignature 6/1>z*M3/00z"<music21.meter.TimeSignature 12/1>z*M3/000z"<music21.meter.TimeSignature 24/1>)r   r+   str)r1   ms     r7   testMeterBrevezTest.testMeterBreveb   s~    w'Q!DEw'Q!DEx(Q!EFy)Q!EFrF   c                    t        t        j                        }|j                          |j                  }|j                          y)zT
        test loading a fake piece with spine paths, lyrics, dynamics, etc.
        N)r   r
   fakeTestr(   r	   show)r1   hdcmss      r7   x_testFakePiecezTest.x_testFakePiecel   s/     $I$6$67		ZZ
	rF   c                   t        t        j                        }|j                          |j                  }d}|j                         D ]  }t        |d      r/|j                  j                  dk(  r|j                  dk(  s8|dz  }>t        |d      sK|j                  D ]'  }|j                  dk(  s|j                  dk(  s#|dz  })  | j                  |d       y )Nr   r<   zG#r:   r   pitchesV   )r   r
   r'   r(   r	   recursehasattrr<   r>   beatrd   r+   )r1   r2   masterStreamgSharpCountnps         r7   testSpineMazurkazTest.testSpineMazurkau   s    #I$6$67
 			zz %%'Aq'"qww||t';66Q;1$KI&Avv~!&&A+#q( # ( 	b)rF   c                j    ddl m} t        j                         dz  }|dz  }|j	                  |      }y )Nr   )	converterhumdrumzMissa_Sine_nomine-Kyrie.krn)music21ro   r   getSourceFilePathr(   )r1   ro   
parserPathsineNominePathunused_myScores        r7   testParseSineNominezTest.testParseSineNomine   s1    %--/);
#&CC"8rF   c                Z   t        t        j                        }|j                          |j                  }| j                  |j                  d   j                  d      j                                | j                  |j                  d   j                  d      j                                y )Nr      r   )
r   r
   splitSpines2r(   r	   
assertTruepartsmeasure	hasVoicesassertFalse)r1   r2   ri   s      r7   testSplitSpineszTest.testSplitSpines   s|    #I$:$:;		zz**1-55a8BBDE++A.66q9CCEFrF   c                n    t        t        j                        }|j                          |j                  }y N)r   r
   r^   r(   r	   )r1   r2   unused_ss      r7   x_testMoveDynamicszTest.x_testMoveDynamics   s$    #I$6$67		::rF   c                    ddl m} t        t        j                        }|j                          |j                  }|j                  |      }| j                  |d       y )Nr   )textzMagijago ickewyan)	rq   r   r   r
   r^   r(   r	   assembleLyricsr+   )r1   r   r2   slyricss        r7   testLyricsInSpinezTest.testLyricsInSpine   sH     #I$6$67		JJ$$Q'!45rF   c                n    t        t        j                        }|j                          |j                  }y)z
        Currently this does not work since a second split on a stream that
        already resulted from a split does not parse properly.  Shows up also
        in strangeWTCOpening, below.
        N)r   r
   	splitLotsr(   r	   r1   r2   unused_masterStreams      r7   testSplitSpines2zTest.testSplitSpines2   s'     $I$7$78		!jjrF   c                N    t        t        j                        }|j                  }y r   )r   r
   strangeWTCOpeningr	   r   s      r7   testParseStrangeSplitzTest.testParseStrangeSplit   s    #I$?$?@!jjrF   c                   t        j                  ddd      }t        |      }|j                          |j                  }| j                  t        |j                        d       t        |j                  d   j                  t        j                              }| j                  |D cg c]  }|j                   c}g d       | j                  |D cg c]  }|j                  j                   c}g d       |\  }}}| j                  |j                                | j                  |j                   D 	cg c]  }	|	j"                  j$                   c}	dg       | j'                  |j                                | j                  t        |j(                        d	       | j                  t+        d
 |j(                  D              ddg       | j                  |j                                | j                  |j                   D 	cg c]  }	|	j"                  j$                   c}	dg       yc c}w c c}w c c}	w c c}	w )a&  
        2/4 piece: m1 has one half note in a single spine; m2 splits into two
        spines (split indicator immediately *after* the =2 barline) with a half
        note on each, merges back to one spine before =3, and m3 has a single
        half note.

        Test is AI-assisted.
        	\s\s\s\s+	z5
**kern
*M2/4
=1
2c
=2
*^
2d    2e
*v    *v
=3
2f
*-
r   r   r   r:             @r   r   Cr:   c              3  j   K   | ]+  }|j                   D ]  }|j                  j                    - y wr   notesr<   r>   .0vrk   s      r7   	<genexpr>z-Test.testSplitAfterBarline.<locals>.<genexpr>   %     DAAGGq177<<G<   13DEFNresubr   r(   r	   r+   lenr{   listgetElementsByClassrL   rM   r?   quarterLengthr~   r}   r   r<   r>   rz   voicessorted
r1   krnr`   r   measuresr[   rW   m2m3rk   s
             r7   testSplitAfterBarlinezTest.testSplitAfterBarline       ff\4 *  $C(		JJQWWq)
55fnnEFH5Hq!((H5yAHEHq!**22HEW
B(91!'',,9C5A'RYY+DDD#J	

 	(91!'',,9C5A 6E : :   (H0H59H:	H?c                   t        j                  ddd      }t        |      }|j                          |j                  }| j                  t        |j                        d       t        |j                  d   j                  t        j                              }| j                  |D cg c]  }|j                   c}g d       | j                  |D cg c]  }|j                  j                   c}g d       |\  }}}| j                  |j                                | j                  |j                   D 	cg c]  }	|	j"                  j$                   c}	dg       | j'                  |j                                | j                  t        |j(                        d	       | j                  t+        d
 |j(                  D              ddg       | j                  |j                                | j                  |j                   D 	cg c]  }	|	j"                  j$                   c}	dg       yc c}w c c}w c c}	w c c}	w )a/  
        Same shape as testSplitAfterBarline but with the spine split placed
        *before* the =2 barline (the barline therefore appears within both new
        spines).  Humdrum syntax permits this; only adjacency rules constrain
        spine path indicators.

        Test is AI-assisted.
        r   r   z;
**kern
*M2/4
=1
2c
*^
=2    =2
2d    2e
*v    *v
=3
2f
*-
r   r   r   r   r   r:   c              3  j   K   | ]+  }|j                   D ]  }|j                  j                    - y wr   r   r   s      r7   r   z.Test.testSplitBeforeBarline.<locals>.<genexpr>  r   r   r   r   r   Nr   r   s
             r7   testSplitBeforeBarlinezTest.testSplitBeforeBarline   r   r   c                   t        j                  ddd      }t        |      }|j                          |j                  }| j                  t        |j                        d       t        |j                  d   j                  t        j                              }| j                  |D cg c]  }|j                   c}g d       | j                  |D cg c]  }|j                  j                   c}g d       |\  }}}| j                  |j                                | j                  |j                   D 	cg c]  }	|	j"                  j$                   c}	dg       | j'                  |j                                | j                  t        |j(                        d	       | j                  t+        d
 |j(                  D              ddg       | j'                  |j                                | j                  t        |j(                        d	       | j                  t+        d |j(                  D              ddg       yc c}w c c}w c c}	w )a  
        2/4 piece: m1 has one half note in a single spine; m2 splits into two
        spines (half note on each), then merges back to one spine at the end of
        m2; m3 immediately splits again into two spines (half note on each)
        and the piece ends without re-merging.

        Expected layout: one Part with three Measures, each two quarters long;
        m1 has no voices, m2 and m3 each have two voices with one half note
        each.

        Test is AI-assisted.
        r   r   zD
**kern
*M2/4
=1
2c
=2
*^
2d    2e
*v    *v
=3
*^
2f    2g
*-    *-
r   r   r   r   r   r:   c              3  j   K   | ]+  }|j                   D ]  }|j                  j                    - y wr   r   r   s      r7   r   z6Test.testSplitMergeImmediateResplit.<locals>.<genexpr>I  r   r   r   r   c              3  j   K   | ]+  }|j                   D ]  }|j                  j                    - y wr   r   r   s      r7   r   z6Test.testSplitMergeImmediateResplit.<locals>.<genexpr>P  r   r   r   GNr   r   s
             r7   testSplitMergeImmediateResplitz#Test.testSplitMergeImmediateResplit  s    ff\4 *  $C(		JJQWWq)
55fnnEFH5Hq!((H5yAHEHq!**22HEW
B(91!'',,9C5A'RYY+DDD#J	

 	'RYY+DDD#J	
! 6E :s   (II	9Ic           	     ~   t        j                  ddd      }t        |      }|j                          |j                  j                         j                  t        j                        D cg c]2  }|j                  t        |j                  |j                              f4 }}| j                  |g d       yc c}w )z
        ``**dynam`` events on the same line as a kern note attach at that note's
        offset.  Sanity-check companion to testDynamAttachedMisaligned.

        Test is AI-assisted.
        r   r   z
**kern    **dynam
*staff1    *staff1
*M4/4     *
=1        =1
2c        f
2d        p
=2        =2
4e        sf
4f        .
4g        .
4a        .
*-        *-
f        )rl   r   sf      @Nr   r   r   r(   r	   rf   r   r   DynamicvaluefloatgetOffsetInHierarchyr+   r1   r   r`   dfounds        r7   testDynamAttachedAlignedzTest.testDynamAttachedAlignedT  s     ff\4 *  $C(		**,,.AA(BRBRSUSQ ''5!7!7

!CDES 	 U EFU   ,7B:zHKnown pre-existing gap; see TODO in SpineCollection.attachNonKernEvents.c           	     ~   t        j                  ddd      }t        |      }|j                          |j                  j                         j                  t        j                        D cg c]2  }|j                  t        |j                  |j                              f4 }}| j                  |g d       yc c}w )a^  
        A ``**dynam`` event on a line where the kern column has '.' (no new note
        event) should still attach -- to the stream at the offset of the most
        recently-sounding note.  Currently fails: misaligned dynamics are
        silently dropped.  See TODO in `SpineCollection.attachNonKernEvents`.

        Test is AI-assisted.
        r   r   z
**kern    **dynam
*staff1    *staff1
*M4/4     *
=1        =1
2c        f
.         p
2d        .
=2        =2
4e        sf
4f        .
4g        .
4a        .
*-        *-
)r   )rl   r   r   Nr   r   s        r7   testDynamAttachedMisalignedz Test.testDynamAttachedMisalignedo  s     ff\4 *  $C(		**,,.AA(BRBRSUSQ ''5!7!7

!CDES 	 U 	 EF	Ur   c           	     ~   t        j                  ddd      }t        |      }|j                          |j                  j                         j                  t        j                        D cg c]2  }|j                  t        |j                  |j                              f4 }}| j                  |g d       yc c}w )aK  
        A ``**harm`` event on a line where the kern column has '.' should still
        attach -- to the stream at the offset of the most recently-sounding
        note.  Currently fails: misaligned harm events are silently dropped.
        See TODO in `SpineCollection.attachNonKernEvents`.

        Test is AI-assisted.
        r   r   z
**kern    **harm
*staff1    *staff1
*M4/4     *
*C:       *C:
=1        =1
2c        I
.         V
2g        .
=2        =2
4f        IV
4g        V
4a        vi
4c        I
*-        *-
)Ir   )Vr   )IVr   )r         @)vi      @)r         @N)r   r   r   r(   r	   rf   r   r   RomanNumeralfigurer   r   r+   )r1   r   r`   rr   s        r7   testHarmAttachedMisalignedzTest.testHarmAttachedMisaligned  s     ff\4 *   $C(		**,,.AA%BTBTUWUQ ((E!"8"8"DEFU 	 W 	V	
Wr   c                   t        j                  ddd      }t        |      }|j                          |j                  }| j                  t        |j                        d       t        |j                  d   j                  t        j                              }| j                  |D cg c]  }|j                   c}g d       | j                  |D cg c]  }|j                  j                   c}g d       |\  }}}| j                  |j                  D 	cg c]  }	|	j                  j                    c}	dg       | j                  t#        d	 |j$                  D              d
dg       | j                  |j                  D 	cg c]  }	|	j                  j                    c}	dg       yc c}w c c}w c c}	w c c}	w )z
        Blank lines should not affect parsing.  Same shape as
        testSplitAfterBarline but with blank lines sprinkled throughout.

        Test is AI-assisted.
        r   r   z;

**kern
*M2/4

=1
2c

=2
*^

2d    2e
*v    *v

=3

2f
*-
r   r   r   r   r   c              3  j   K   | ]+  }|j                   D ]  }|j                  j                    - y wr   r   r   s      r7   r   z8Test.testBlankLinesPreserveSplitParse.<locals>.<genexpr>  r   r   r   r   r   N)r   r   r   r(   r	   r+   r   r{   r   r   rL   rM   r?   r   r   r<   r>   r   r   r   s
             r7    testBlankLinesPreserveSplitParsez%Test.testBlankLinesPreserveSplitParse  s^    ff\4 * & $C(		JJQWWq)
55fnnEFH5Hq!((H5yAHEHq!**22HEW
B91!'',,9C5ADDD#J	
 	91!'',,9C5A 6E :
 :s   (F.F3F8F=c           	     \   t        j                  ddd      }t        |      }|j                          |j                  }|j                         j                  t        j                        D cg c](  }|j                  t        |j                  |            f* }}|j                         j                  t        j                        D cg c](  }|j                  t        |j                  |            f* }}| j                  |g d       | j                  |g d       yc c}w c c}w )z
        Blank lines mixed into a kern + dynam + harm piece should not affect
        which events attach where.

        Test is AI-assisted.
        r   r   a7  
**kern    **dynam    **harm
*staff1    *staff1    *staff1
*M4/4     *         *
*C:       *         *C:

=1        =1        =1
2c        f         I

2d        p         V
=2        =2        =2

4e        sf        I
4f        .         IV
4g        .         V
4a        .         vi
*-        *-        *-
r   )r   )r   r   )r   r   )r   r   )r   r   )r   r   N)r   r   r   r(   r	   rf   r   r   r   r   r   r   r   r   r   r+   )r1   r   r`   r   r   dynr   harms           r7   "testBlankLinesPreserveDynamAndHarmz'Test.testBlankLinesPreserveDynamAndHarm  s    ff\4 * $ $C(		JJ		66x7G7GHJH1 q55a89:H 	 J 778J8JKMKA 5!7!7!:;<K 	 MCDV	
JMs   .-D$-D)c                <   t        j                  ddd      }t        |      }|j                          |j                  j                         j                  D cg c]$  }|j                  j                  |j                  f& }}| j                  |g d       yc c}w )a	  
        Verify that each lyric syllable from a ``**text`` spine attaches to the
        kern note on the same line.  Existing testLyricsInSpine only checks
        the assembled lyric string; this checks the per-note mapping.

        Test is AI-assisted.
        r   r   z
**kern    **text
*staff1    *staff1
*M4/4     *
=1        =1
4c        Ma
4d        gi
4e        ja
4f        go
*-        *-
))r   Ma)r   gi)r   ja)r   goN)r   r   r   r(   r	   rf   r   r<   r>   lyricr+   )r1   r   r`   rk   notesAndLyricss        r7   testLyricsCorrectlyAlignedzTest.testLyricsCorrectlyAligned  s     ff\4 
* 
 $C(		#&::#5#5#7#=#=?#=a 77<<1#= 	 ?@	
?s   )Bc                   t        t        j                        }|j                          |j                  }|j
                  d   }g }|t           D ]  }|j                  |j                          | j                  d|v        y )Nr:   zspine comment)
r   r
   r^   r(   r	   r{   r   appendcommentrz   )r1   r2   r   rl   commentscs         r7   testSpineCommentszTest.testSpineComments#  se    #I$6$67		JJGGAJ<AOOAII& !834rF   c                   t        t        j                        }|j                          |j                  }i ddg dddddfddg d	d
d
ddfddg dddddfddg dddddfddg dddddfddg dddddfddg dddddfdd g d!dd"d#dfd$d%g d&d"d
d'd(fd)dg dddddfd*dg dddddfd+d,g d-ddddfd.d/g d0d
d
ddfd1d2g d3d4d4ddfd5d6g d7d8dd#dfd9d:g d;ddddfd<d=g dddddfd>g d?d@dAd#dfd=g dddddfdBg dCd
dAdDd(fd=g dddddfdEg dFd@dAd'd(fdGg dHddddfd=g dddddfd=g dddddfdIg dddddfdJ	}|j                         j                  t        j                        D ]  }|j                  }|j                  }|j                         j                  }|j                         j                  }|j                         }	|j                         }
|||||	|
f}| j!                  |||j"                             y )KNr   I in C majorr   rx      r   5   F      ?zii in C major)r:   r   r   r   r   ziii in C major)rx   r      r         @zIV in C major)r   r   r   r   r   zI64 in C major)r   r   rx   r   @   r   zV in C major)r   r   r:   r   zvi in C majorr   r   rx   Ar   zV6 in C major)r   r:   r   Br          @zviio65/i in C majorr:   r      r   A   T      "@      &@      (@zi in c minor)r   r   r         *@ziio in c minor)r:   r   r        ,@zIII in c minor)r   r   r   zE-      .@zN6 in c minor)r   r  r   zD-      0@zi64 in c minor)r   r   r         1@zV in c minorzIt6 in c minor)r  r   r   zF#zA-zFr43 in c minor)r  r   r:   r   +   zGer65 in c minor)r  r   r   r   ziv in c minor)r   r  r   zI in c minor	      2@g      4@g      5@g      7@      8@      ;@      >@g      @@g     @@)r   r
   harmScaleDegreesr(   r	   flattenr   r   r   figureAndKeypitchClassesrootr>   bassinversionName	isSeventhr+   offsetr1   r2   r   groundTruthr   r  r  r  r  r  r  assertTuples               r7   testHarmSpineDegreeszTest.testHarmSpineDegrees.  s   #I$>$>?		JJ
.)S#r5A
/9c3EB
 "JS"eD
 /9c3EB	

 "IsCUC
 .*c3EB
 /9c3EB
 /:sCEB
 'S"dK
 .)S#r5A
 >9c3EB
 >9c3EB
 #YS"eD
 #ZtRG
 ?ItS!UC
  #YS"eD!
" >:sCUC#
$ $YdAuE!:sCUC$lCr4H!:sCUC%|T4TJ"IsCUC!:sCUC!:sCUC!9c3EB5
8 IIK2253E3EFD,,L,,L99;##D99;##D ..0M(IK [+dkk*BC GrF   c                   t        t        j                        }|j                          |j                  }i ddg dddddfddg d	d
d
ddfddg dddddfddg dddddfddg dddddfddg dddddfddg dddddfdd g d!ddd"d#fd$d%g dddddfd&d'g dddddfd(d)g dddddfd*d+g dddddfd,d-g d	d
d
ddfd.d/g dddddfd0d1g d2ddddfd3d4g d5ddd"d#fd6d7g d8ddd9dfd:g d;d
dd<dfd=g d>ddd9dfd?g d@ddd<dfdAg dBdddCdfdg dddddfdDg dEdddCdfd g d!ddd"d#fdFg dGddd9dfdHg dIddd<dfdJg dKddd9dfdLg dMddd<dfdNg dOd
ddCdfd/g dddddfdPg dQdddCdfd4g d5ddd"d#fdR}|j                         j                  t        j                        D ]  }|j                  }|j                  }|j                         j                  }|j                         j                  }|j                         }	|j                         }
|||||	|
f}| j!                  |||j"                             y )SNr   zI7 in C major)r   rx   r   r   r   r   Tr   zIV7 in C major)r   r   r   rx   r   r   zviio7 in C major)r   r:   r   r  r   r   ziii7 in C major)rx   r   r   r:   r   r   zvi7 in C major)r   r   rx   r   r   r   zii7 in C major)r:   r   r   r   r   r   zV7 in C major)r   r   r:   r   r   r   r   r   r   Fr  zi7 in a minorr  ziv7 in a minorr	  z-VII7 in a minorr
  zIII7 in a minorr  zVI7 in a minorr  ziio7 in a minorr  zV7 in a minor)rx   r  r   r:   g      3@zi in a minorr   r  zI65 in C major)rx   r   r   r   r  zIV2 in C major)rx   r   r   r   *   zviio65 in C majorr  ziii2 in C major)r:   rx   r   r   zvi43 in C major)rx   r   r   r   r  zV43 in C major)r:   r   r   r   zi65 in a minor)r   rx   r   r   ziv2 in a minor)r   r:   r   r   z-VII65 in a minor)r   r:   r   r   zIII2 in a minor)r   r   rx   r   zVI43 in a minor)r   rx   r   r   zV43 in a minor)r   r:   rx   r  )g      9@g      :@r  g      <@g      =@r  g      ?@g      B@g     B@g      C@g     C@g      D@g     D@g      E@g     E@)r   r
   harmSeventhsr(   r	   r  r   r   r   r  r  r  r>   r  r  r  r+   r  r  s               r7   testHarmSpineSeventhszTest.testHarmSpineSevenths_  s~   #I$:$:;		JJ!
/=#sAtD!
"L#sAtD!
 $mS#q$G!
 #]CaF	!

 "L#sAtD!
 "L#sAtD!
 /=#sAtD!
 .)S#r5A!
 ?L#sAtD!
 #\3QE!
 %}c34H!
 $mS#q$G!
 #\3QE!
 $mS#q$G!
 ?M3QE!
  >9c3EB!!
" #]Cb$G#!
$ $\3RF&sCTJ$mS#r4H$lCb$G#\3QE#]Cb$G!9c3EB#\3RF#\3RF&sCTJ$mS#r4H$lCb$G$mS#q$G#]Cb$G!9c3EBA!
D IIK2253E3EFD,,L,,L99;##D99;##D ..0M(IK [+dkk*BC GrF   c                   t        t        j                        }|j                          |j                  }i ddddddddddddddd	dd
ddddddddddddddddddddddddddd	}|j                         j                  t        j                        D ]g  }|j                         }|j                         }|j                         }|j                         }||||f}	| j                  |	||j                            i y )Nr   )FFFFr   r   r   r   r   r   r   r  r  r  r  r  r	  r
  r  r  )TTFF)TFTF)TFFTr  )r   r
   r  r(   r	   r  r   r   r   isAugmentedSixthisItalianAugmentedSixthisFrenchAugmentedSixthisGermanAugmentedSixthr+   r  )
r1   r2   r   r  r   r%  r&  r'  r(  r  s
             r7   testHarmSpineAugmentedSixthsz!Test.testHarmSpineAugmentedSixths  s   #I$>$>?		JJ
-
 -
 -	

 -
 -
 -
 -
 -
 -
 -
 .
 .
 .
 .
  .!
" .#
$ .%
& -.,.,....7
: IIK2253E3EFD#446&*&B&B&D#%)%@%@%B"%)%@%@%B" '&&	K [+dkk*BC GrF   c                    ddl m} |j                  d      }|j                  }| j	                  |j
                         | j                  d|j
                         y )Nr   )corpuszpalestrina/agnus_0
Palestrina)rq   r+  r(   metadataassertIsNotNonecomposerassertIn)r1   r+  r   mds       r7   testMetadataRetrievedzTest.testMetadataRetrieved  sA    "LL-.ZZR[[)lBKK0rF   c                   t         d   }dt         d<   t        t        j                        }|j	                          |j
                  }dt         d<   t        t        j                        }|j	                          |j
                  }|t         d<   |j                  d   j                  d      j                  d   }|j                  d   j                  d      j                  d   }| j                  |j                  j                  d       | j                  |j                  j                  d       | j                  t        |j                  j                  d   j                        d       | j                  |j                  j                  d   j                  j                  d       | j                  |j                  j                  d       | j                  |j                  j                  d       | j                  t        |j                  j                  d   j                        d	       | j                  |j                  j                  d   j                  j                  d       y )
NJRPFTr   r   zEighth Triplet (1/2 QL)z8DurationTuple(type='eighth', dots=1, quarterLength=0.75)zDotted Eighth Triplet (1/2 QL)z7DurationTuple(type='eighth', dots=0, quarterLength=0.5))r   r   r
   dottedTupletr(   r	   r{   r|   r   r+   r?   fullNamer@   reprrA   rB   )r1   
prevFlavorr`   r   hdc2r   cndns           r7   testFlavorszTest.testFlavors  s   U^
#I$:$:;		JJ$Y%;%;<

KK#WWQZ"((+WWQZ"((+--/HI))1-bkk11!4CCDS	U,,Q/>>CCQG--/OP))1-bkk11!4CCDR	T,,Q/>>CCQGrF   N) __name__
__module____qualname__r8   rE   rX   r\   rb   rm   rv   r   r   r   r   r   r   r   r   r   unittestskipr   r   r   r   r   r   r  r#  r)  r2  r<   rF   r7   r   r   )   s     1DG9G*D9G6))+BZ+BZ4
lG6 X]] : ;G;G@ X]] : ;!
;!
F)BV$
L
85/Db5Dn,D\1HrF   r   c                      e Zd ZdZd Zy)TestExternalTc                    t        t        j                        }|j                          | j                  r|j
                  j	                          y y r   )r   r
   
sousaStarsr(   r_   r	   )r1   r2   s     r7   testShowSousazTestExternal.testShowSousa  s5    #I$8$89		99JJOO rF   N)r=  r>  r?  r_   rG  rB  rF   r7   rD  rD    s    DrF   rD  __main__)__doc__
__future__r   r   r@  rq   r   r   r   r   r   r	   music21.humdrumr
   music21.humdrum.spineParserr   r   r   r   r   r   r   TestCaser   rD  r=  mainTestrB  rF   r7   <module>rO     s    # 	        %  x
H8 x
Hv8$$  zGT rF   