2
2
import os
3
3
import shutil
4
4
import unittest
5
- import testgres
6
- from pg_probackup2 .app import ProbackupApp
7
- from pg_probackup2 .init_helpers import Init , init_params
8
- from pg_probackup2 . app import build_backup_dir
5
+ from ...... import testgres
6
+ from ... pg_probackup2 .app import ProbackupApp
7
+ from ... pg_probackup2 .init_helpers import Init , init_params
8
+ from .. storage . fs_backup import FSTestBackupDir
9
9
10
10
11
11
class TestUtils :
@@ -37,11 +37,11 @@ def setup_test_environment(self):
37
37
def setup_test_paths (self ):
38
38
self .rel_path = os .path .join (self .module_name , self .fname )
39
39
self .test_path = os .path .join (init_params .tmp_path , self .rel_path )
40
- os .makedirs (self .test_path )
40
+ os .makedirs (self .test_path , exist_ok = True )
41
41
self .pb_log_path = os .path .join (self .test_path , "pb_log" )
42
42
43
43
def setup_backup_dir (self ):
44
- self .backup_dir = build_backup_dir (self , 'backup' )
44
+ self .backup_dir = self . build_backup_dir ('backup' )
45
45
self .backup_dir .cleanup ()
46
46
47
47
def setup_probackup (self ):
@@ -53,6 +53,8 @@ def tearDown(self):
53
53
if os .path .exists (self .test_path ):
54
54
shutil .rmtree (self .test_path )
55
55
56
+ def build_backup_dir (self , backup = 'backup' ):
57
+ return FSTestBackupDir (rel_path = self .rel_path , backup = backup )
56
58
57
59
class BasicTest (ProbackupTest ):
58
60
def test_full_backup (self ):
0 commit comments