@@ -296,9 +296,11 @@ def test_arhive_push_file_exists(self):
296
296
297
297
wals_dir = os .path .join (backup_dir , 'wal' , 'node' )
298
298
if self .archive_compress :
299
- file = os .path .join (wals_dir , '000000010000000000000001.gz' )
299
+ filename = '000000010000000000000001.gz'
300
+ file = os .path .join (wals_dir , filename )
300
301
else :
301
- file = os .path .join (wals_dir , '000000010000000000000001' )
302
+ filename = '000000010000000000000001'
303
+ file = os .path .join (wals_dir , filename )
302
304
303
305
with open (file , 'a' ) as f :
304
306
f .write (b"blablablaadssaaaaaaaaaaaaaaa" )
@@ -319,7 +321,8 @@ def test_arhive_push_file_exists(self):
319
321
'LOG: archive command failed with exit code 1' in log_content and
320
322
'DETAIL: The failed archive command was:' in log_content and
321
323
'INFO: pg_probackup archive-push from' in log_content and
322
- 'ERROR: WAL segment "{0}" already exists.' .format (file ) in log_content ,
324
+ 'ERROR: WAL segment ' in log_content and
325
+ '{0}" already exists.' .format (filename ) in log_content ,
323
326
'Expecting error messages about failed archive_command'
324
327
)
325
328
self .assertFalse ('pg_probackup archive-push completed successfully' in log_content )
@@ -369,9 +372,11 @@ def test_arhive_push_file_exists_overwrite(self):
369
372
370
373
wals_dir = os .path .join (backup_dir , 'wal' , 'node' )
371
374
if self .archive_compress :
372
- file = os .path .join (wals_dir , '000000010000000000000001.gz' )
375
+ filename = '000000010000000000000001.gz'
376
+ file = os .path .join (wals_dir , filename )
373
377
else :
374
- file = os .path .join (wals_dir , '000000010000000000000001' )
378
+ filename = '000000010000000000000001'
379
+ file = os .path .join (wals_dir , filename )
375
380
376
381
with open (file , 'a' ) as f :
377
382
f .write (b"blablablaadssaaaaaaaaaaaaaaa" )
@@ -392,7 +397,7 @@ def test_arhive_push_file_exists_overwrite(self):
392
397
'LOG: archive command failed with exit code 1' in log_content and
393
398
'DETAIL: The failed archive command was:' in log_content and
394
399
'INFO: pg_probackup archive-push from' in log_content and
395
- 'ERROR: WAL segment " {0}" already exists.' .format (file ) in log_content ,
400
+ '{0}" already exists.' .format (filename ) in log_content ,
396
401
'Expecting error messages about failed archive_command'
397
402
)
398
403
self .assertFalse ('pg_probackup archive-push completed successfully' in log_content )
0 commit comments