Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit091b7c6

Browse files
committed
tests: minor fixes for Windows
1 parenta712882 commit091b7c6

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

‎tests/archive.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,11 @@ def test_arhive_push_file_exists(self):
296296

297297
wals_dir=os.path.join(backup_dir,'wal','node')
298298
ifself.archive_compress:
299-
file=os.path.join(wals_dir,'000000010000000000000001.gz')
299+
filename='000000010000000000000001.gz'
300+
file=os.path.join(wals_dir,filename)
300301
else:
301-
file=os.path.join(wals_dir,'000000010000000000000001')
302+
filename='000000010000000000000001'
303+
file=os.path.join(wals_dir,filename)
302304

303305
withopen(file,'a')asf:
304306
f.write(b"blablablaadssaaaaaaaaaaaaaaa")
@@ -319,7 +321,8 @@ def test_arhive_push_file_exists(self):
319321
'LOG: archive command failed with exit code 1'inlog_contentand
320322
'DETAIL: The failed archive command was:'inlog_contentand
321323
'INFO: pg_probackup archive-push from'inlog_contentand
322-
'ERROR: WAL segment "{0}" already exists.'.format(file)inlog_content,
324+
'ERROR: WAL segment 'inlog_contentand
325+
'{0}" already exists.'.format(filename)inlog_content,
323326
'Expecting error messages about failed archive_command'
324327
)
325328
self.assertFalse('pg_probackup archive-push completed successfully'inlog_content)
@@ -369,9 +372,11 @@ def test_arhive_push_file_exists_overwrite(self):
369372

370373
wals_dir=os.path.join(backup_dir,'wal','node')
371374
ifself.archive_compress:
372-
file=os.path.join(wals_dir,'000000010000000000000001.gz')
375+
filename='000000010000000000000001.gz'
376+
file=os.path.join(wals_dir,filename)
373377
else:
374-
file=os.path.join(wals_dir,'000000010000000000000001')
378+
filename='000000010000000000000001'
379+
file=os.path.join(wals_dir,filename)
375380

376381
withopen(file,'a')asf:
377382
f.write(b"blablablaadssaaaaaaaaaaaaaaa")
@@ -392,7 +397,7 @@ def test_arhive_push_file_exists_overwrite(self):
392397
'LOG: archive command failed with exit code 1'inlog_contentand
393398
'DETAIL: The failed archive command was:'inlog_contentand
394399
'INFO: pg_probackup archive-push from'inlog_contentand
395-
'ERROR: WAL segment "{0}" already exists.'.format(file)inlog_content,
400+
'{0}" already exists.'.format(filename)inlog_content,
396401
'Expecting error messages about failed archive_command'
397402
)
398403
self.assertFalse('pg_probackup archive-push completed successfully'inlog_content)

‎tests/backup_test.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -610,17 +610,17 @@ def test_tablespace_handling(self):
610610
"drop tablespace some_lame_tablespace")
611611

612612
self.backup_node(
613-
backup_dir,'node',node,backup_type="delta",
614-
options=["-j","4","--stream"])
613+
backup_dir,'node',node,backup_type="delta",
614+
options=["-j","4","--stream"])
615615

616616
self.restore_node(
617-
backup_dir,'node',node_restored,
618-
options=[
619-
"-j","4",
620-
"-T","{0}={1}".format(
621-
tblspace1_old_path,tblspace1_new_path),
622-
"-T","{0}={1}".format(
623-
tblspace2_old_path,tblspace2_new_path)])
617+
backup_dir,'node',node_restored,
618+
options=[
619+
"-j","4",
620+
"-T","{0}={1}".format(
621+
tblspace1_old_path,tblspace1_new_path),
622+
"-T","{0}={1}".format(
623+
tblspace2_old_path,tblspace2_new_path)])
624624

625625
ifself.paranoia:
626626
pgdata=self.pgdata_content(node.data_dir)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp