Fix style-checker errors

This commit is contained in:
Takeshi KOMIYA 2016-05-29 17:16:46 +09:00
parent b81f24e0b6
commit d7113586f1

View File

@ -16,10 +16,10 @@ from util import TestApp
def test_correct_year(): def test_correct_year():
try: try:
# save current value of SOURCE_DATE_EPOCH # save current value of SOURCE_DATE_EPOCH
sde = os.environ.pop('SOURCE_DATE_EPOCH',None) sde = os.environ.pop('SOURCE_DATE_EPOCH', None)
# test with SOURCE_DATE_EPOCH unset: no modification # test with SOURCE_DATE_EPOCH unset: no modification
app = TestApp(buildername='html',testroot='correct-year') app = TestApp(buildername='html', testroot='correct-year')
app.builder.build_all() app.builder.build_all()
content = (app.outdir / 'contents.html').text() content = (app.outdir / 'contents.html').text()
app.cleanup() app.cleanup()
@ -28,14 +28,14 @@ def test_correct_year():
# test with SOURCE_DATE_EPOCH set: copyright year should be # test with SOURCE_DATE_EPOCH set: copyright year should be
# updated # updated
os.environ['SOURCE_DATE_EPOCH'] = "1293840000" os.environ['SOURCE_DATE_EPOCH'] = "1293840000"
app = TestApp(buildername='html',testroot='correct-year') app = TestApp(buildername='html', testroot='correct-year')
app.builder.build_all() app.builder.build_all()
content = (app.outdir / 'contents.html').text() content = (app.outdir / 'contents.html').text()
app.cleanup() app.cleanup()
assert '2006-2011' in content assert '2006-2011' in content
os.environ['SOURCE_DATE_EPOCH'] = "1293839999" os.environ['SOURCE_DATE_EPOCH'] = "1293839999"
app = TestApp(buildername='html',testroot='correct-year') app = TestApp(buildername='html', testroot='correct-year')
app.builder.build_all() app.builder.build_all()
content = (app.outdir / 'contents.html').text() content = (app.outdir / 'contents.html').text()
app.cleanup() app.cleanup()
@ -43,7 +43,7 @@ def test_correct_year():
finally: finally:
# Restores SOURCE_DATE_EPOCH # Restores SOURCE_DATE_EPOCH
if sde == None: if sde is None:
os.environ.pop('SOURCE_DATE_EPOCH',None) os.environ.pop('SOURCE_DATE_EPOCH', None)
else: else:
os.environ['SOURCE_DATE_EPOCH'] = sde os.environ['SOURCE_DATE_EPOCH'] = sde