Improve pylint testing, fixed a few issues.

This commit is contained in:
Tomas Groth 2016-08-01 19:42:29 +02:00
parent 291c9c8902
commit 189b2dd400
2 changed files with 3 additions and 3 deletions

View File

@ -458,7 +458,7 @@ class OpenLyrics(object):
self._add_tag_to_formatting(tag, tags_element) self._add_tag_to_formatting(tag, tags_element)
# Replace end tags. # Replace end tags.
for tag in end_tags: for tag in end_tags:
text = text.replace('{/{tag}}}'.format(tag=tag), '</tag>') text = text.replace('{{{tag}}}'.format(tag=tag), '</tag>')
# Replace \n with <br/>. # Replace \n with <br/>.
text = text.replace('\n', '<br/>') text = text.replace('\n', '<br/>')
element = etree.XML('<lines>{text}</lines>'.format(text=text)) element = etree.XML('<lines>{text}</lines>'.format(text=text))
@ -643,7 +643,7 @@ class OpenLyrics(object):
# Append text from tail and add formatting end tag. # Append text from tail and add formatting end tag.
# TODO: Verify format() with template variables # TODO: Verify format() with template variables
if element.tag == NSMAP % 'tag' and use_endtag: if element.tag == NSMAP % 'tag' and use_endtag:
text += '{/{name}}}'.format(name=element.get('name')) text += '{{{name}}}'.format(name=element.get('name'))
# Append text from tail. # Append text from tail.
if element.tail: if element.tail:
text += element.tail text += element.tail

View File

@ -48,7 +48,7 @@ class TestPylint(TestCase):
""" """
# GIVEN: Some checks to disable and enable, and the pylint script # GIVEN: Some checks to disable and enable, and the pylint script
disabled_checks = 'import-error,no-member' disabled_checks = 'import-error,no-member'
enabled_checks = 'missing-format-argument-key,unused-format-string-argument' enabled_checks = 'missing-format-argument-key,unused-format-string-argument,bad-format-string'
if is_win() or 'arch' in platform.dist()[0].lower(): if is_win() or 'arch' in platform.dist()[0].lower():
pylint_script = 'pylint' pylint_script = 'pylint'
else: else: