Fix some pylint warnings
This commit is contained in:
parent
c15f3c89fa
commit
47a3980b12
@ -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
|
||||||
|
|
||||||
|
@ -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-'))
|
||||||
|
|
||||||
|
|
||||||
|
@ -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/"""
|
||||||
|
@ -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"""
|
||||||
|
Loading…
Reference in New Issue
Block a user