def test_parse(self):
for file in os.listdir(SAMPLE_DIR):
if not file.endswith('.rst'):
continue
filename = os.path.join(SAMPLE_DIR, file)
article = parse_article(filename)
rendered = article.render().strip()
with open(filename) as f:
source = f.read().strip()
source = source.expandtabs(4).decode('utf8')
if source != rendered:
lev_ = distance(source, rendered)
jaro_ = jaro(source, rendered)
if lev_ > 10 and jaro_ < 0.8 and file not in MUTATED_FILES:
print('%d %f %s' % (lev_, jaro_, filename))
raise AssertionError(filename)
评论列表
文章目录