Browse Source

fix newline tests

content_repeat
oliverpool 7 years ago
parent
commit
865e980579
  1. 2
      patacrep/songs/chordpro/ast.py
  2. 3
      patacrep/songs/chordpro/syntax.py
  3. 6
      test/test_patatools/test_convert.py
  4. 2
      test/test_song/newline.crlf.csg
  5. 2
      test/test_song/newline.crlf.html
  6. 2
      test/test_song/newline.crlf.tsg
  7. 2
      test/test_song/newline.csg
  8. 2
      test/test_song/newline.html
  9. 2
      test/test_song/newline.tsg

2
patacrep/songs/chordpro/ast.py

@ -388,7 +388,7 @@ class VerseDirective(Directive):
def __init__(self, keyword, argument=None): def __init__(self, keyword, argument=None):
if keyword not in VERSE_DIRECTIVES: if keyword not in VERSE_DIRECTIVES:
#TODO Raise better exception #TODO Raise better exception
raise Exception raise Exception(keyword)
super().__init__(keyword, argument) super().__init__(keyword, argument)
@property @property

3
patacrep/songs/chordpro/syntax.py

@ -262,7 +262,8 @@ class ChordproParser(Parser):
keyword = symbols[3] keyword = symbols[3]
argument = symbols[4] argument = symbols[4]
symbols[0] = ast.VerseDirective(keyword, argument) if keyword != "newline":
symbols[0] = ast.VerseDirective(keyword, argument)
@staticmethod @staticmethod
def p_directive_next(symbols): def p_directive_next(symbols):

6
test/test_patatools/test_convert.py

@ -70,10 +70,8 @@ class TestConvert(unittest.TestCase, metaclass=dynamic.DynamicTest):
with logging_reduced(): with logging_reduced():
if os.path.exists(destname): if os.path.exists(destname):
os.remove(destname) os.remove(destname)
self.assertEqual( with self.assertRaises(Exception):
self._system(main, args + [in_format, out_format, sourcename]), self._system(main, args + [in_format, out_format, sourcename])
1,
)
@staticmethod @staticmethod
@contextlib.contextmanager @contextlib.contextmanager

2
test/test_song/newline.crlf.csg

@ -38,4 +38,4 @@ New lines can also
Be surrounded by spaces Be surrounded by spaces
New lines cannot New lines cannot appear in the middle of a line

2
test/test_song/newline.crlf.html

@ -38,6 +38,6 @@ Be in bridges
Be surrounded by spaces Be surrounded by spaces
</p> </p>
<p class="verse">New lines cannot <p class="verse">New lines cannot appear in the middle of a line
</p> </p>
</div> </div>

2
test/test_song/newline.crlf.tsg

@ -55,7 +55,7 @@
\begin{verse} \begin{verse}
New lines cannot New lines cannot appear in the middle of a line
\end{verse} \end{verse}
\endsong \endsong

2
test/test_song/newline.csg

@ -38,4 +38,4 @@ New lines can also
Be surrounded by spaces Be surrounded by spaces
New lines cannot New lines cannot appear in the middle of a line

2
test/test_song/newline.html

@ -38,6 +38,6 @@ Be in bridges
Be surrounded by spaces Be surrounded by spaces
</p> </p>
<p class="verse">New lines cannot <p class="verse">New lines cannot appear in the middle of a line
</p> </p>
</div> </div>

2
test/test_song/newline.tsg

@ -55,7 +55,7 @@
\begin{verse} \begin{verse}
New lines cannot New lines cannot appear in the middle of a line
\end{verse} \end{verse}
\endsong \endsong

Loading…
Cancel
Save