Merge "Fake http_connect in test_replicator test"

This commit is contained in:
Jenkins 2013-08-01 17:30:04 +00:00 committed by Gerrit Code Review
commit ac78185fa1

View File

@ -287,13 +287,15 @@ class TestObjectReplicator(unittest.TestCase):
self.replicator.logger.log_dict['warning'])
def test_delete_partition(self):
df = diskfile.DiskFile(self.devices, 'sda', '0', 'a', 'c', 'o',
FakeLogger())
mkdirs(df.datadir)
part_path = os.path.join(self.objects, '1')
self.assertTrue(os.access(part_path, os.F_OK))
self.replicator.replicate()
self.assertFalse(os.access(part_path, os.F_OK))
with mock.patch('swift.obj.replicator.http_connect',
mock_http_connect(200)):
df = diskfile.DiskFile(self.devices,
'sda', '0', 'a', 'c', 'o', FakeLogger())
mkdirs(df.datadir)
part_path = os.path.join(self.objects, '1')
self.assertTrue(os.access(part_path, os.F_OK))
self.replicator.replicate()
self.assertFalse(os.access(part_path, os.F_OK))
def test_delete_partition_override_params(self):
df = diskfile.DiskFile(self.devices, 'sda', '0', 'a', 'c', 'o',