pep8 and add tags_test

This commit is contained in:
Kovid Goyal 2013-09-22 09:54:23 +05:30
parent 87a8f703be
commit 7a39bc6368

View File

@ -67,6 +67,18 @@ def authors_test(authors):
return test
def tags_test(tags):
tags = set([x.lower() for x in tags])
def test(mi):
t = set([x.lower() for x in mi.tags])
if t == tags:
return True
prints('Tags test failed. Expected: \'%s\' found \'%s\''%(tags, t))
return False
return test
def series_test(series, series_index):
series = series.lower()
@ -75,10 +87,10 @@ def series_test(series, series_index):
if (ms == series) and (series_index == mi.series_index):
return True
if mi.series:
prints('Series test failed. Expected: \'%s [%d]\' found \'%s[%d]\''% \
prints('Series test failed. Expected: \'%s [%d]\' found \'%s[%d]\''%
(series, series_index, ms, mi.series_index))
else:
prints('Series test failed. Expected: \'%s [%d]\' found no series'% \
prints('Series test failed. Expected: \'%s [%d]\' found no series'%
(series, series_index))
return False