corrected some PEP8 problems reported by jenkins

This commit is contained in:
Robin Lutz 2017-09-14 14:21:31 +02:00
parent b712f971f7
commit e1428dec5f

View File

@ -23,8 +23,6 @@ import salt.modules.portage_config as portage_config
@skipIf(NO_MOCK, NO_MOCK_REASON)
class PortageConfigTestCase(TestCase, LoaderModuleMockMixin):
class DummyAtom(object):
def __init__(self):
self.cp = None
self.repo = None
@ -39,11 +37,11 @@ class PortageConfigTestCase(TestCase, LoaderModuleMockMixin):
atom, self.repo = atom.split('::') if '::' in atom else (atom, None)
# remove '>, >=, <=, =, ~' etc.
atom = re.sub('[<>~+=]', '', atom)
atom = re.sub(r'[<>~+=]', '', atom)
# remove slots
atom = re.sub(':[0-9][^:]*', '', atom)
atom = re.sub(r':[0-9][^:]*', '', atom)
# remove version
atom = re.sub('-[0-9][\.0-9]*', '', atom)
atom = re.sub(r'-[0-9][\.0-9]*', '', atom)
self.cp = atom
return self
@ -52,7 +50,7 @@ class PortageConfigTestCase(TestCase, LoaderModuleMockMixin):
try:
import portage
return {}
except:
except ImportError:
dummy_atom = self.DummyAtom()
self.portage = MagicMock()
self.portage.dep.Atom = MagicMock(side_effect=dummy_atom)
@ -121,5 +119,4 @@ class PortageConfigTestCase(TestCase, LoaderModuleMockMixin):
for line in fh:
self.assertTrue(atom in line, msg="'{}' not in '{}'".format(addition, line))
for addition in additions:
self.assertTrue(addition in line, msg="'{}' not in '{}'".format(addition, line))
self.assertTrue(addition in line, msg="'{}' not in '{}'".format(addition, line))