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

[tests] test_corrupt_backup_content was updated [typos, new asserts]#633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
dmitry-lipetsk wants to merge1 commit intopostgrespro:master
base:master
Choose a base branch
Loading
fromdmitry-lipetsk:D20240725_02--test_corrupt_backup_content
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletionstests/config_test.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -71,15 +71,15 @@ def test_corrupt_backup_content(self):
'postgres',
'create table t1()')

fulle2_id = self.backup_node(backup_dir, 'node', node)
full2_id = self.backup_node(backup_dir, 'node', node)

fulle1_conf_file = os.path.join(
full1_conf_file = os.path.join(
backup_dir, 'backups','node', full1_id, 'backup_content.control')

fulle2_conf_file = os.path.join(
backup_dir, 'backups','node',fulle2_id, 'backup_content.control')
full2_conf_file = os.path.join(
backup_dir, 'backups','node',full2_id, 'backup_content.control')

copyfile(fulle2_conf_file, fulle1_conf_file)
copyfile(full2_conf_file, full1_conf_file)

try:
self.validate_pb(backup_dir, 'node')
Expand All@@ -90,7 +90,7 @@ def test_corrupt_backup_content(self):
repr(self.output), self.cmd))
except ProbackupException as e:
self.assertIn(
"WARNING: Invalid CRC of backup control file '{0}':".format(fulle1_conf_file),
"WARNING: Invalid CRC of backup control file '{0}':".format(full1_conf_file),
e.message,
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
repr(e.message), self.cmd))
Expand All@@ -107,7 +107,8 @@ def test_corrupt_backup_content(self):
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
repr(e.message), self.cmd))

self.show_pb(backup_dir, 'node', full1_id)['status']
self.assertEqual(self.show_pb(backup_dir, 'node', full1_id)['status'], 'CORRUPT')
self.assertEqual(self.show_pb(backup_dir, 'node', full2_id)['status'], 'OK')

self.assertEqual(self.show_pb(backup_dir, 'node')[0]['status'], 'CORRUPT')
Copy link
Author

@dmitry-lipetskdmitry-lipetskJul 25, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If you want, I can replace last two lines with something like this, too:

info=self.show_pb(backup_dir,'node')self.assertIsNotNone(info)self.assertEqual(len(info),2)self.assertIsNotNone(info[0])self.assertIsNotNone(info[1])self.assertIn('status',info[0].keys())self.assertIn('status',info[1].keys())self.assertEqual(info[0]['status'],'CORRUPT')self.assertEqual(info[1]['status'],'OK')

self.assertEqual(self.show_pb(backup_dir, 'node')[1]['status'], 'OK')

[8]ページ先頭

©2009-2025 Movatter.jp