Fix some pylint warnings

This commit is contained in:
Brian C. Lane 2018-03-22 17:25:00 -07:00
parent c15f3c89fa
commit 47a3980b12
4 changed files with 6 additions and 7 deletions

View File

@ -218,8 +218,8 @@ class LoraxTemplateRunner(object):
# log the "ErrorType: this is what happened" line # log the "ErrorType: this is what happened" line
logger.error(" " + exclines[-1].strip()) logger.error(" " + exclines[-1].strip())
# and log the entire traceback to the debug log # and log the entire traceback to the debug log
for line in ''.join(exclines).splitlines(): for l in ''.join(exclines).splitlines():
logger.debug(" " + line) logger.debug(" " + l)
if self.fatalerrors: if self.fatalerrors:
raise raise

View File

@ -14,7 +14,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
import inspect
import unittest import unittest
from flask import Flask from flask import Flask
from datetime import timedelta from datetime import timedelta
@ -97,7 +96,7 @@ class CrossdomainTest(unittest.TestCase):
# when attach_to_all is False the decorator will not assign # when attach_to_all is False the decorator will not assign
# the Access-Control-* headers to the response # the Access-Control-* headers to the response
for header, value in response.headers: for header, _ in response.headers:
self.assertFalse(header.startswith('Access-Control-')) self.assertFalse(header.startswith('Access-Control-'))

View File

@ -518,8 +518,8 @@ class ServerTestCase(unittest.TestCase):
self.assertEqual(200, response.status_code) self.assertEqual(200, response.status_code)
self.assertTrue(len(response.data) > 1024) self.assertTrue(len(response.data) > 1024)
# look for some well known strings inside the documentation # look for some well known strings inside the documentation
self.assertRegexpMatches(response.data, "Lorax [\d.]+ documentation") self.assertRegexpMatches(response.data, r"Lorax [\d.]+ documentation")
self.assertRegexpMatches(response.data, "Copyright \d+, Red Hat, Inc.") self.assertRegexpMatches(response.data, r"Copyright \d+, Red Hat, Inc.")
def test_api_docs(self): def test_api_docs(self):
"""Test the /api/docs/""" """Test the /api/docs/"""

View File

@ -72,7 +72,7 @@ class WorkspaceTest(unittest.TestCase):
# The recipe was written by the workspace_write test. # The recipe was written by the workspace_write test.
with self.assertRaises(recipes.RecipeFileError): with self.assertRaises(recipes.RecipeFileError):
with mock.patch('pylorax.api.workspace.recipe_from_toml', side_effect=IOError('TESTING')): with mock.patch('pylorax.api.workspace.recipe_from_toml', side_effect=IOError('TESTING')):
recipe = workspace_read(self.repo, "master", "http-server") workspace_read(self.repo, "master", "http-server")
def test_05_workspace_delete(self): def test_05_workspace_delete(self):
"""Test the workspace_delete function""" """Test the workspace_delete function"""