Skip to content

Commit c4259b8

Browse files
committed
PGPRO-1918 tests: minor fixes
1 parent e91e9d8 commit c4259b8

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

tests/locking.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def test_locking_running_validate_2_specific_id(self):
192192
"Backup {0} has status RUNNING, change it "
193193
"to ERROR and skip validation".format(
194194
backup_id) in e.message and
195-
"WARNING: Some backups are not valid" in
195+
"ERROR: Backup {0} has status: ERROR".format(backup_id) in
196196
e.message,
197197
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
198198
repr(e.message), self.cmd))
@@ -203,6 +203,35 @@ def test_locking_running_validate_2_specific_id(self):
203203
self.assertEqual(
204204
'ERROR', self.show_pb(backup_dir, 'node')[1]['status'])
205205

206+
try:
207+
self.validate_pb(backup_dir, 'node', backup_id)
208+
self.assertEqual(
209+
1, 0,
210+
"Expecting Error because backup has status ERROR.\n "
211+
"Output: {0} \n CMD: {1}".format(
212+
repr(self.output), self.cmd))
213+
except ProbackupException as e:
214+
self.assertIn(
215+
"ERROR: Backup {0} has status: ERROR".format(backup_id),
216+
e.message,
217+
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
218+
repr(e.message), self.cmd))
219+
220+
try:
221+
self.validate_pb(backup_dir)
222+
self.assertEqual(
223+
1, 0,
224+
"Expecting Error because backup has status ERROR.\n "
225+
"Output: {0} \n CMD: {1}".format(
226+
repr(self.output), self.cmd))
227+
except ProbackupException as e:
228+
self.assertTrue(
229+
"WARNING: Backup {0} has status ERROR. Skip validation".format(
230+
backup_id) in e.message and
231+
"WARNING: Some backups are not valid" in e.message,
232+
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
233+
repr(e.message), self.cmd))
234+
206235
# Clean after yourself
207236
self.del_test_dir(module_name, fname)
208237

0 commit comments

Comments
 (0)