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

Commit04af42c

Browse files
committed
tests: changes in "init" and "restore" modules for Windows
1 parentb70b9a2 commit04af42c

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

‎tests/init_test.py‎renamed to ‎tests/init.py‎

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ def test_success(self):
2121
['backups','wal']
2222
)
2323
self.add_instance(backup_dir,'node',node)
24-
self.assertEqual("INFO: Instance 'node' successfully deleted\n",self.del_instance(backup_dir,'node'),
24+
self.assertIn(
25+
"INFO: Instance 'node' successfully deleted",
26+
self.del_instance(backup_dir,'node'),
2527
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(repr(self.output),self.cmd))
2628

2729
# Show non-existing instance
@@ -30,8 +32,9 @@ def test_success(self):
3032
self.assertEqual(1,0,'Expecting Error due to show of non-existing instance. Output: {0}\n CMD: {1}'.format(
3133
repr(self.output),self.cmd))
3234
exceptProbackupExceptionase:
33-
self.assertEqual(e.message,
34-
"ERROR: Instance 'node' does not exist in this backup catalog\n",
35+
self.assertIn(
36+
"ERROR: Instance 'node' does not exist in this backup catalog",
37+
e.message,
3538
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(e.message,self.cmd))
3639

3740
# Delete non-existing instance
@@ -40,8 +43,9 @@ def test_success(self):
4043
self.assertEqual(1,0,'Expecting Error due to delete of non-existing instance. Output: {0}\n CMD: {1}'.format(
4144
repr(self.output),self.cmd))
4245
exceptProbackupExceptionase:
43-
self.assertEqual(e.message,
44-
"ERROR: Instance 'node1' does not exist in this backup catalog\n",
46+
self.assertIn(
47+
"ERROR: Instance 'node1' does not exist in this backup catalog",
48+
e.message,
4549
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(e.message,self.cmd))
4650

4751
# Add instance without pgdata
@@ -54,8 +58,9 @@ def test_success(self):
5458
self.assertEqual(1,0,'Expecting Error due to adding instance without pgdata. Output: {0}\n CMD: {1}'.format(
5559
repr(self.output),self.cmd))
5660
exceptProbackupExceptionase:
57-
self.assertEqual(e.message,
58-
"ERROR: Required parameter not specified: PGDATA (-D, --pgdata)\n",
61+
self.assertIn(
62+
"ERROR: Required parameter not specified: PGDATA (-D, --pgdata)",
63+
e.message,
5964
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(e.message,self.cmd))
6065

6166
# Clean after yourself
@@ -73,8 +78,9 @@ def test_already_exist(self):
7378
self.assertEqual(1,0,'Expecting Error due to initialization in non-empty directory. Output: {0}\n CMD: {1}'.format(
7479
repr(self.output),self.cmd))
7580
exceptProbackupExceptionase:
76-
self.assertEqual(e.message,
77-
"ERROR: Instance 'node' does not exist in this backup catalog\n",
81+
self.assertIn(
82+
"ERROR: Instance 'node' does not exist in this backup catalog",
83+
e.message,
7884
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(repr(e.message),self.cmd))
7985

8086
# Clean after yourself
@@ -91,8 +97,9 @@ def test_abs_path(self):
9197
self.assertEqual(1,0,'Expecting Error due to initialization with non-absolute path in --backup-path. Output: {0}\n CMD: {1}'.format(
9298
repr(self.output),self.cmd))
9399
exceptProbackupExceptionase:
94-
self.assertEqual(e.message,
95-
"ERROR: -B, --backup-path must be an absolute path\n",
100+
self.assertIn(
101+
"ERROR: -B, --backup-path must be an absolute path",
102+
e.message,
96103
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(repr(e.message),self.cmd))
97104

98105
# Clean after yourself

‎tests/restore.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ def test_restore_with_tablespace_mapping_1(self):
810810
repr(self.output),self.cmd))
811811
exceptProbackupExceptionase:
812812
self.assertIn(
813-
'ERROR: restore destination is not empty: "{0}"'.format(node.data_dir),
813+
'ERROR: restore destination is not empty:',
814814
e.message,
815815
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
816816
repr(e.message),self.cmd))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp