@@ -55,21 +55,21 @@ def test_barline_and_ts_behavior(self):
5555 m2 = Measure (chords = 'G' )
5656 s = Song (title = TITLE , composer_name_first = COMPOSER_NAME_FIRST , composer_name_last = COMPOSER_NAME_LAST , measures = [m1 , m2 ])
5757 self .assertEqual (s .url (urlencode = False ),
58- 'irealbook://A Test Song=Jackson Arthur "Two-Sheds"=Medium Swing=C=n=[T44C |G Z' )
58+ 'irealbook://A Test Song=Jackson Arthur "Two-Sheds"=Medium Swing=C=n=[T44C, , , |G, , , Z' )
5959 m3 = Measure (chords = 'A' , barline_open = '{' , time_sig = TimeSignature (3 , 4 ))
6060 m4 = Measure (chords = 'D' , barline_close = '}' , time_sig = TimeSignature (3 , 4 ))
6161 s2 = Song (title = TITLE , composer_name_first = COMPOSER_NAME_FIRST , composer_name_last = COMPOSER_NAME_LAST , measures = [m3 , m4 ])
6262
6363 self .assertEqual (s2 .url (urlencode = False ),
64- 'irealbook://A Test Song=Jackson Arthur "Two-Sheds"=Medium Swing=C=n={T34A |D }' )
64+ 'irealbook://A Test Song=Jackson Arthur "Two-Sheds"=Medium Swing=C=n={T34A, , |D, , }' )
6565
6666 def test_empty_measures (self ):
6767 """
6868 Tests expected output of a Song object with no measures
6969 """
7070 s = Song (title = TITLE , composer_name_first = COMPOSER_NAME_FIRST , composer_name_last = COMPOSER_NAME_LAST )
71- self .assertEqual (s .url (), "irealbook://A%20Test%20Song=Jackson%20Arthur%20%22Two-Sheds%22=Medium%20Swing=C=n=%5BT44%20%20%20 %20Z" )
72- self .assertEqual (s .url (urlencode = False ), " irealbook://A Test Song=Jackson Arthur \ " Two-Sheds\ " =Medium Swing=C=n=[T44 Z" )
71+ self .assertEqual (s .url (), "irealbook://A%20Test%20Song=Jackson%20Arthur%20%22Two-Sheds%22=Medium%20Swing=C=n=%5BT44%20%2C% 20%2C%20%2C %20Z" )
72+ self .assertEqual (s .url (urlencode = False ), ' irealbook://A Test Song=Jackson Arthur "Two-Sheds"=Medium Swing=C=n=[T44 , , , Z' )
7373
7474
7575class TestMeasures (unittest .TestCase ):
@@ -106,15 +106,15 @@ def test_measure_string_from_chords_string(self):
106106 """
107107 # TODO test multiple time signatures
108108 m = Measure (chords = 'C' , time_sig = TimeSignature (5 , 4 ))
109- expected_measure_string = 'C |'
109+ expected_measure_string = 'C, , , , |'
110110 self .assertEqual (m .__str__ (), expected_measure_string )
111111
112112 def test_measure_string_from_chords_list (self ):
113113 """
114114 Test that Measure.__str__() returns the expected value when chords are provided as a list.
115115 """
116116 m = Measure (chords = ['C' , None , 'G7' , None ], time_sig = TimeSignature (4 , 4 ))
117- expected_measure_string = 'C G7 |'
117+ expected_measure_string = 'C, ,G7, |'
118118 self .assertEqual (m .__str__ (), expected_measure_string )
119119
120120 def test_modulo_chord_padding (self ):
@@ -124,68 +124,68 @@ def test_modulo_chord_padding(self):
124124 """
125125 chords = ['C' , 'F' ]
126126 m = Measure (chords = chords , time_sig = TimeSignature (4 , 4 ))
127- self .assertEqual (m .__str__ (), 'C F |' )
127+ self .assertEqual (m .__str__ (), 'C, ,F, |' )
128128 m = Measure (chords = chords , time_sig = TimeSignature (6 , 4 ))
129- self .assertEqual (m .__str__ (), 'C F |' )
129+ self .assertEqual (m .__str__ (), 'C, , ,F, , |' )
130130 m = Measure (chords = ['C' , 'F' , 'G' ], time_sig = TimeSignature (6 , 4 ))
131- self .assertEqual (m .__str__ (), 'C F G |' )
131+ self .assertEqual (m .__str__ (), 'C, ,F, ,G, |' )
132132
133133 def test_staff_text (self ):
134134 """
135135 Test that staff text is formatted correctly and in the expected position
136136 """
137137 m = Measure (chords = 'C' , time_sig = TimeSignature (4 , 4 ), staff_text = "Test" )
138- self .assertEqual (m .__str__ (), '<Test>C |' )
138+ self .assertEqual (m .__str__ (), '<Test>C, , , |' )
139139 m = Measure (chords = ['C' , 'F' ], time_sig = TimeSignature (4 , 4 ), staff_text = 'Test' ,
140140 barline_open = '{' , barline_close = '}' )
141- self .assertEqual (m .__str__ (), '{<Test>C F }' )
141+ self .assertEqual (m .__str__ (), '{<Test>C, ,F, }' )
142142 m .render_ts = True
143- self .assertEqual (m .__str__ (), '{T44<Test>C F }' )
143+ self .assertEqual (m .__str__ (), '{T44<Test>C, ,F, }' )
144144
145145 def test_barline_open (self ):
146146 """
147147 Test opening barline options
148148 """
149149 m = Measure (chords = 'C' , barline_open = "" )
150- self .assertEqual (m .__str__ (), 'C |' )
150+ self .assertEqual (m .__str__ (), 'C, , , |' )
151151 m2 = Measure (chords = 'C' , barline_open = '[' )
152- self .assertEqual (m2 .__str__ (), '[C |' )
152+ self .assertEqual (m2 .__str__ (), '[C, , , |' )
153153 m3 = Measure (chords = 'C' , barline_open = '{' )
154154 m3 .render_ts = True
155- self .assertEqual (m3 .__str__ (), '{T44C |' )
155+ self .assertEqual (m3 .__str__ (), '{T44C, , , |' )
156156
157157 def test_barline_close (self ):
158158 """
159159 Test closing barline options
160160 """
161161 m = Measure (chords = 'C' , barline_close = None )
162- self .assertEqual (m .__str__ (), 'C |' )
162+ self .assertEqual (m .__str__ (), 'C, , , |' )
163163 m = Measure (chords = 'C' , barline_close = '' )
164- self .assertEqual (m .__str__ (), 'C |' )
164+ self .assertEqual (m .__str__ (), 'C, , , |' )
165165 m2 = Measure (chords = 'C' , barline_close = ']' )
166- self .assertEqual (m2 .__str__ (), 'C ]' )
166+ self .assertEqual (m2 .__str__ (), 'C, , , ]' )
167167 m3 = Measure (chords = 'C' , barline_close = '}' )
168- self .assertEqual (m3 .__str__ (), 'C }' )
168+ self .assertEqual (m3 .__str__ (), 'C, , , }' )
169169 m4 = Measure (chords = 'C' , barline_close = 'Z' )
170- self .assertEqual (m4 .__str__ (), 'C Z' )
170+ self .assertEqual (m4 .__str__ (), 'C, , , Z' )
171171
172172 def test_ending (self ):
173173 """
174174 Test output of `ending` property
175175 """
176176 m = Measure (chords = 'C' , ending = 'N1' , barline_close = '}' )
177- self .assertEqual (m .__str__ (), 'N1C }' )
177+ self .assertEqual (m .__str__ (), 'N1C, , , }' )
178178 m1 = Measure (chords = ['C' , 'G7' ], ending = "N2" , barline_close = '}' , render_ts = True )
179- self .assertEqual (m1 .__str__ (), 'T44N2C G7 }' )
179+ self .assertEqual (m1 .__str__ (), 'T44N2C, ,G7, }' )
180180
181181 def test_rehearsal_marks (self ):
182182 """
183183 Test behavior of the rehearsal_marks property
184184 """
185185 m = Measure (chords = 'C' , rehearsal_marks = "*A" , barline_open = "[" , render_ts = True )
186- self .assertEqual (m .__str__ (), '*A[T44C |' )
186+ self .assertEqual (m .__str__ (), '*A[T44C, , , |' )
187187 m1 = Measure (chords = ['G' , 'C7' ], rehearsal_marks = ['*B' , 'Q' ])
188- self .assertEqual (m1 .__str__ (), '*BG C7 Q|' )
188+ self .assertEqual (m1 .__str__ (), '*BG, ,C7, Q|' )
189189 with self .assertRaises (ValueError ):
190190 Measure (chords = 'G' , rehearsal_marks = ['M' ])
191191
@@ -248,9 +248,8 @@ def test_blues(self):
248248
249249 s .measures .append (Measure (chords = 'G7' , ending = 'N2' ))
250250 s .measures .append (Measure (chords = 'G7' , barline_close = 'Z' ))
251-
252- self .assertEqual (s .url (), "irealbook://Automation%20Blues=Matonne%20Otto=New%20Orleans%20Swing=G=n=%7BT44%3CGenerated%20by%20pyrealpro%3EG7%20%20%20%7CG7%20%20%20%7CG7%20%20%20%7CG7%20%20%20%5D%5BC7%20%20%20%7CC7%20%20%20%7CG7%20%20%20%7CG7%20%20%20%5D%5BD7%20%20%20%7CC7%20%20%20%7CN1G7%20%20%20%7CD7%20%20%20%7DN2G7%20%20%20%7CG7%20%20%20Z" )
253- self .assertEqual (s .url (urlencode = False ), "irealbook://Automation Blues=Matonne Otto=New Orleans Swing=G=n={T44<Generated by pyrealpro>G7 |G7 |G7 |G7 ][C7 |C7 |G7 |G7 ][D7 |C7 |N1G7 |D7 }N2G7 |G7 Z" )
251+ self .assertEqual (s .url (), "irealbook://Automation%20Blues=Matonne%20Otto=New%20Orleans%20Swing=G=n=%7BT44%3CGenerated%20by%20pyrealpro%3EG7%2C%20%2C%20%2C%20%7CG7%2C%20%2C%20%2C%20%7CG7%2C%20%2C%20%2C%20%7CG7%2C%20%2C%20%2C%20%5D%5BC7%2C%20%2C%20%2C%20%7CC7%2C%20%2C%20%2C%20%7CG7%2C%20%2C%20%2C%20%7CG7%2C%20%2C%20%2C%20%5D%5BD7%2C%20%2C%20%2C%20%7CC7%2C%20%2C%20%2C%20%7CN1G7%2C%20%2C%20%2C%20%7CD7%2C%20%2C%20%2C%20%7DN2G7%2C%20%2C%20%2C%20%7CG7%2C%20%2C%20%2C%20Z" )
252+ self .assertEqual (s .url (urlencode = False ), "irealbook://Automation Blues=Matonne Otto=New Orleans Swing=G=n={T44<Generated by pyrealpro>G7, , , |G7, , , |G7, , , |G7, , , ][C7, , , |C7, , , |G7, , , |G7, , , ][D7, , , |C7, , , |N1G7, , , |D7, , , }N2G7, , , |G7, , , Z" )
254253
255254
256255if __name__ == '__main__' :
0 commit comments