Browse Source

fix newline tests

content_repeat
oliverpool 7 years ago
parent
commit
865e980579
  1. 2
      patacrep/songs/chordpro/ast.py
  2. 1
      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):
if keyword not in VERSE_DIRECTIVES:
#TODO Raise better exception
raise Exception
raise Exception(keyword)
super().__init__(keyword, argument)
@property

1
patacrep/songs/chordpro/syntax.py

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

6
test/test_patatools/test_convert.py

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

2
test/test_song/newline.crlf.csg

@ -38,4 +38,4 @@ New lines can also
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
</p>
<p class="verse">New lines cannot
<p class="verse">New lines cannot appear in the middle of a line
</p>
</div>

2
test/test_song/newline.crlf.tsg

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

2
test/test_song/newline.csg

@ -38,4 +38,4 @@ New lines can also
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
</p>
<p class="verse">New lines cannot
<p class="verse">New lines cannot appear in the middle of a line
</p>
</div>

2
test/test_song/newline.tsg

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

Loading…
Cancel
Save