Fix lint in unit tests re: py3-first and py2 compat
Change-Id: Iaafe2c368390706a61976d3f13fd83d515ce4b3e
This commit is contained in:
parent
06ac9046a1
commit
5b701b511d
@ -28,7 +28,7 @@ class CephBrokerTestCase(unittest.TestCase):
|
|||||||
def test_process_requests_invalid_api_version(self, mock_log):
|
def test_process_requests_invalid_api_version(self, mock_log):
|
||||||
req = json.dumps({'api-version': 2, 'ops': []})
|
req = json.dumps({'api-version': 2, 'ops': []})
|
||||||
rc = ceph_broker.process_requests(req)
|
rc = ceph_broker.process_requests(req)
|
||||||
print "Return: %s" % rc
|
print("Return: {}".format(rc))
|
||||||
self.assertEqual(json.loads(rc),
|
self.assertEqual(json.loads(rc),
|
||||||
{'exit-code': 1,
|
{'exit-code': 1,
|
||||||
'stderr': 'Missing or invalid api version (2)'})
|
'stderr': 'Missing or invalid api version (2)'})
|
||||||
|
@ -110,7 +110,7 @@ def patch_open():
|
|||||||
|
|
||||||
Yields the mock for "open" and "file", respectively.'''
|
Yields the mock for "open" and "file", respectively.'''
|
||||||
mock_open = MagicMock(spec=open)
|
mock_open = MagicMock(spec=open)
|
||||||
mock_file = MagicMock(spec=file)
|
mock_file = MagicMock(spec=file) # noqa - transitional py2 py3
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def stub_open(*args, **kwargs):
|
def stub_open(*args, **kwargs):
|
||||||
|
Loading…
Reference in New Issue
Block a user