forked from openlp/openlp
fixed a pep-issue in songs-lib and corrected a comment in a test
This commit is contained in:
parent
1cd7d73d10
commit
c2d1589dcb
@ -213,7 +213,7 @@ class VerseType(object):
|
|||||||
for num, tag in enumerate(VerseType.tags):
|
for num, tag in enumerate(VerseType.tags):
|
||||||
if verse_tag == tag:
|
if verse_tag == tag:
|
||||||
return num
|
return num
|
||||||
if default in range(0,len(VerseType.names)) or default is None:
|
if default in range(0, len(VerseType.names)) or default is None:
|
||||||
return default
|
return default
|
||||||
else:
|
else:
|
||||||
return VerseType.Other
|
return VerseType.Other
|
||||||
@ -231,7 +231,7 @@ class VerseType(object):
|
|||||||
for num, tag in enumerate(VerseType.translated_tags):
|
for num, tag in enumerate(VerseType.translated_tags):
|
||||||
if verse_tag == tag:
|
if verse_tag == tag:
|
||||||
return num
|
return num
|
||||||
if default in range(0,len(VerseType.names)) or default is None:
|
if default in range(0, len(VerseType.names)) or default is None:
|
||||||
return default
|
return default
|
||||||
else:
|
else:
|
||||||
return VerseType.Other
|
return VerseType.Other
|
||||||
|
@ -484,5 +484,5 @@ class TestVerseType(TestCase):
|
|||||||
# WHEN: We run the from_tag() method with an invalid verse type, we get the specified default back
|
# WHEN: We run the from_tag() method with an invalid verse type, we get the specified default back
|
||||||
result = VerseType.from_tag('m', None)
|
result = VerseType.from_tag('m', None)
|
||||||
|
|
||||||
# THEN: The result should be VerseType.Other
|
# THEN: The result should be None
|
||||||
self.assertIsNone(result, 'The result should be None, but was "%s"' % result)
|
self.assertIsNone(result, 'The result should be None, but was "%s"' % result)
|
||||||
|
Loading…
Reference in New Issue
Block a user