def test_multi_search(pg_xlog):
 for i in range(3):
  ready = ((str(i) * 8) * 3)
  pg_xlog.touch(ready, '.ready')
 complete_segment_name = (('F' * 8) * 3)
 pg_xlog.touch(complete_segment_name, '.done')
 ready_history_file_name = (('F' * 8) + '.history')
 pg_xlog.touch(ready_history_file_name, '.ready')
 segs = worker.WalSegment.from_ready_archive_status(str(pg_xlog.pg_xlog))
 for (i, seg) in enumerate(segs):
  assert (seg.name == ((str(i) * 8) * 3))
 assert (i == 2)
 pg_xlog.assert_exists(complete_segment_name, '.done')
 pg_xlog.assert_exists(ready_history_file_name, '.ready')

def test_multi_search ( pg_xlog ) : for i in range ( 3 ) : ready = ( ( str ( i ) * 8 ) * 3 ) pg_xlog . touch ( ready , '.ready' ) complete_segment_name = ( ( 'F' * 8 ) * 3 ) pg_xlog . touch ( complete_segment_name , '.done' ) ready_history_file_name = ( ( 'F' * 8 ) + '.history' ) pg_xlog . touch ( ready_history_file_name , '.ready' ) segs = worker . WalSegment . from_ready_archive_status ( str ( pg_xlog . pg_xlog ) ) for ( i , seg ) in enumerate ( segs ) : assert ( seg . name == ( ( str ( i ) * 8 ) * 3 ) ) assert ( i == 2 ) pg_xlog . assert_exists ( complete_segment_name , '.done' ) pg_xlog . assert_exists ( ready_history_file_name , '.ready' )
test finding a few ready files .