MCPcopy Create free account
hub / github.com/wal-e/wal-e / CleanupCheckingUploader

Class CleanupCheckingUploader

tests/test_wal_transfer.py:191–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189 segOK = FakeWalSegment('2' * 8 * 3)
190
191 class CleanupCheckingUploader(object):
192 def __init__(self):
193 self.cleaned_up = False
194
195 def __call__(self, segment):
196 if segment is segOK:
197 try:
198 while True:
199 gevent.sleep(0.1)
200 finally:
201 self.cleaned_up = True
202
203 elif segment is segBad:
204 raise Explosion('fail')
205
206 else:
207 assert False, 'Expect only two segments'
208
209 segment._uploaded = True
210 return segment
211
212 uploader = CleanupCheckingUploader()
213 group = worker.WalTransferGroup(uploader)

Callers 1

test_finally_executionFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_finally_executionFunction · 0.68