Reduce line count by two
Change-Id: Ib0ee2bb5b202966d3d07c754656c92006149af9c
This commit is contained in:
parent
e16ea691d0
commit
0d710140c5
@ -160,8 +160,7 @@ class TestAuditor(unittest.TestCase):
|
|||||||
|
|
||||||
def blowup(*args):
|
def blowup(*args):
|
||||||
raise NameError('tpyo')
|
raise NameError('tpyo')
|
||||||
with mock.patch('swift.obj.diskfile.DiskFile',
|
with mock.patch('swift.obj.diskfile.DiskFile', blowup):
|
||||||
blowup):
|
|
||||||
auditor_worker.failsafe_object_audit(
|
auditor_worker.failsafe_object_audit(
|
||||||
AuditLocation(os.path.dirname(path), 'sda', '0'))
|
AuditLocation(os.path.dirname(path), 'sda', '0'))
|
||||||
self.assertEquals(auditor_worker.errors, 1)
|
self.assertEquals(auditor_worker.errors, 1)
|
||||||
@ -182,8 +181,7 @@ class TestAuditor(unittest.TestCase):
|
|||||||
'Content-Length': str(os.fstat(writer._fd).st_size),
|
'Content-Length': str(os.fstat(writer._fd).st_size),
|
||||||
}
|
}
|
||||||
writer.put(metadata)
|
writer.put(metadata)
|
||||||
with mock.patch('swift.obj.diskfile.DiskFile',
|
with mock.patch('swift.obj.diskfile.DiskFile', lambda *_: 1 / 0):
|
||||||
lambda *_: 1 / 0):
|
|
||||||
auditor_worker.audit_all_objects()
|
auditor_worker.audit_all_objects()
|
||||||
self.assertEquals(auditor_worker.errors, pre_errors + 1)
|
self.assertEquals(auditor_worker.errors, pre_errors + 1)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user