@@ -296,9 +296,11 @@ def test_arhive_push_file_exists(self):
296296
297297wals_dir = os .path .join (backup_dir ,'wal' ,'node' )
298298if self .archive_compress :
299- file = os .path .join (wals_dir ,'000000010000000000000001.gz' )
299+ filename = '000000010000000000000001.gz'
300+ file = os .path .join (wals_dir ,filename )
300301else :
301- file = os .path .join (wals_dir ,'000000010000000000000001' )
302+ filename = '000000010000000000000001'
303+ file = os .path .join (wals_dir ,filename )
302304
303305with open (file ,'a' )as f :
304306f .write (b"blablablaadssaaaaaaaaaaaaaaa" )
@@ -319,7 +321,8 @@ def test_arhive_push_file_exists(self):
319321'LOG: archive command failed with exit code 1' in log_content and
320322'DETAIL: The failed archive command was:' in log_content and
321323'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 ,
323326'Expecting error messages about failed archive_command'
324327 )
325328self .assertFalse ('pg_probackup archive-push completed successfully' in log_content )
@@ -369,9 +372,11 @@ def test_arhive_push_file_exists_overwrite(self):
369372
370373wals_dir = os .path .join (backup_dir ,'wal' ,'node' )
371374if self .archive_compress :
372- file = os .path .join (wals_dir ,'000000010000000000000001.gz' )
375+ filename = '000000010000000000000001.gz'
376+ file = os .path .join (wals_dir ,filename )
373377else :
374- file = os .path .join (wals_dir ,'000000010000000000000001' )
378+ filename = '000000010000000000000001'
379+ file = os .path .join (wals_dir ,filename )
375380
376381with open (file ,'a' )as f :
377382f .write (b"blablablaadssaaaaaaaaaaaaaaa" )
@@ -392,7 +397,7 @@ def test_arhive_push_file_exists_overwrite(self):
392397'LOG: archive command failed with exit code 1' in log_content and
393398'DETAIL: The failed archive command was:' in log_content and
394399'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 ,
396401'Expecting error messages about failed archive_command'
397402 )
398403self .assertFalse ('pg_probackup archive-push completed successfully' in log_content )