1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-09-16 09:26:30 +02:00

tests: windows support for test_restore_with_tablespace_mapping_1

This commit is contained in:
Grigory Smolkin
2018-12-27 13:18:19 +03:00
parent c7dee40d13
commit 8f9ca4ae9f

View File

@@ -840,7 +840,10 @@ class RestoreTest(ProbackupTest, unittest.TestCase):
repr(e.message), self.cmd))
# 2 - Try to restore to existing tablespace directory
shutil.rmtree(node.data_dir, ignore_errors=True)
tblspc_path_tmp = os.path.join(node.base_dir, "tblspc_tmp")
os.rename(tblspc_path, tblspc_path_tmp)
node.cleanup()
os.rename(tblspc_path_tmp, tblspc_path)
try:
self.restore_node(backup_dir, 'node', node)
# we should die here because exception is what we expect to happen
@@ -850,10 +853,9 @@ class RestoreTest(ProbackupTest, unittest.TestCase):
"not empty.\n Output: {0} \n CMD: {1}".format(
repr(self.output), self.cmd))
except ProbackupException as e:
self.assertEqual(
self.assertIn(
'ERROR: restore tablespace destination is not empty:',
e.message,
'ERROR: restore tablespace destination '
'is not empty: "{0}"\n'.format(tblspc_path),
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
repr(e.message), self.cmd))