Browse Source

improve test_parser docstring

pull/174/head
Oliverpool 9 years ago
parent
commit
9d74a41f53
  1. 11
      test/test_chordpro/test_parser.py

11
test/test_chordpro/test_parser.py

@ -20,9 +20,12 @@ OUTPUTS = ['csg', 'tsg', 'html']
class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest):
"""Test of chorpro parser, and several renderers. """Test of chorpro parser, and several renderers.
For any given `foo.source`, it is parsed as a chordpro file, and should be For any given `foo.input_format.source`, the file is parsed as `input_format` and
rendered as `foo.csg` with the chordpro renderer, and `foo.tsg` with the rendered as many times as a `foo.out_format` exists (if `out_format` is a supported
latex renderer. output format).
For instance `foo.csg.source` (chordpro song) will be rendered as LaTeX, if a file
`foo.tsg` exitsts. The result of the rendering will be compared with the `foo.tsg` file.
This class does nothing by itself, but its metaclass populates it with test This class does nothing by itself, but its metaclass populates it with test
methods testing parser and renderers. methods testing parser and renderers.
@ -47,7 +50,7 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest):
yield yield
def assertRender(self, base, in_format, out_format): # pylint: disable=invalid-name def assertRender(self, base, in_format, out_format): # pylint: disable=invalid-name
"""Assert that `{base}.source` is correctly rendered in the `out_format`. """Assert that `{base}.{in_format}.source` is correctly rendered in the `out_format`.
""" """
sourcename = "{}.{}.source".format(base, in_format) sourcename = "{}.{}.source".format(base, in_format)
destname = "{}.{}".format(base, out_format) destname = "{}.{}".format(base, out_format)

Loading…
Cancel
Save