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

Commit88b2742

Browse files
committed
tests minor fixes
1 parent49a8575 commit88b2742

21 files changed

+12
-90
lines changed

‎tests/backup_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
importos
33
fromtimeimportsleep
44
from .helpers.ptrack_helpersimportProbackupTest,ProbackupException
5-
fromtestgresimportstop_all,clean_all
6-
importshutil
75

86

97
classBackupTest(ProbackupTest,unittest.TestCase):

‎tests/delete_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
importunittest
22
importos
33
from .helpers.ptrack_helpersimportProbackupTest,ProbackupException
4-
fromtestgresimportstop_all,clean_all
54
importsubprocess
6-
importshutil
75

86

97
classDeleteTest(ProbackupTest,unittest.TestCase):

‎tests/false_positive.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
importos
33
from .helpers.ptrack_helpersimportProbackupTest,ProbackupException
44
fromdatetimeimportdatetime,timedelta
5-
fromtestgresimportstop_all,clean_all
65
importsubprocess
7-
importshutil
86

97

108
classFalsePositive(ProbackupTest,unittest.TestCase):

‎tests/init_test.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
importunittest
2-
fromsysimportexit
31
importos
4-
fromosimportpath
2+
importunittest
53
from .helpers.ptrack_helpersimportdir_files,ProbackupTest,ProbackupException
6-
fromtestgresimportstop_all,clean_all
7-
importshutil
84

95

106
classInitTest(ProbackupTest,unittest.TestCase):
@@ -67,7 +63,7 @@ def test_abs_path(self):
6763
backup_dir=os.path.join(self.tmp_path,self.module_name,fname,'backup')
6864
node=self.make_simple_node(base_dir="{0}/{1}/node".format(self.module_name,fname))
6965
try:
70-
self.run_pb(["init","-B",path.relpath("%s/backup"%node.base_dir,self.dir_path)])
66+
self.run_pb(["init","-B",os.path.relpath("%s/backup"%node.base_dir,self.dir_path)])
7167
self.assertEqual(1,0,'Expecting Error due to initialization with non-absolute path in --backup-path. Output: {0}\n CMD: {1}'.format(
7268
repr(self.output),self.cmd))
7369
exceptProbackupExceptionase:

‎tests/option_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
importunittest
22
importos
33
from .helpers.ptrack_helpersimportProbackupTest,ProbackupException
4-
fromtestgresimportstop_all,clean_all
5-
importshutil
64

75

86
classOptionTest(ProbackupTest,unittest.TestCase):

‎tests/pgpro560.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
importunittest
33
from .helpers.ptrack_helpersimportProbackupTest,ProbackupException,idx_ptrack
44
fromdatetimeimportdatetime,timedelta
5-
fromtestgresimportstop_all,clean_all
65
importsubprocess
7-
importshutil
86

97

108
classCheckSystemID(ProbackupTest,unittest.TestCase):

‎tests/pgpro589.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
importunittest
33
from .helpers.ptrack_helpersimportProbackupTest,ProbackupException,idx_ptrack
44
fromdatetimeimportdatetime,timedelta
5-
fromtestgresimportstop_all,clean_all
65
importsubprocess
7-
importshutil
86

97

108
classArchiveCheck(ProbackupTest,unittest.TestCase):

‎tests/ptrack_clean.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
importos
22
importunittest
3-
fromtestgresimportstop_all,clean_all
43
from .helpers.ptrack_helpersimportProbackupTest,idx_ptrack
5-
importshutil
64

75

86
classSimpleTest(ProbackupTest,unittest.TestCase):

‎tests/ptrack_cluster.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
importos
22
importunittest
3-
fromtestgresimportstop_all,clean_all
43
from .helpers.ptrack_helpersimportProbackupTest,idx_ptrack
5-
importshutil
64

75

86
classSimpleTest(ProbackupTest,unittest.TestCase):

‎tests/ptrack_move_to_tablespace.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
importos
22
importunittest
3-
fromtestgresimportclean_all,stop_all
43
from .helpers.ptrack_helpersimportProbackupTest,idx_ptrack
5-
importshutil
64

75

86
classSimpleTest(ProbackupTest,unittest.TestCase):
97
def__init__(self,*args,**kwargs):
108
super(SimpleTest,self).__init__(*args,**kwargs)
119
self.module_name='ptrack_move_to_tablespace'
1210

13-
# @classmethod
14-
# def tearDownClass(cls):
15-
# clean_all()
16-
# shutil.rmtree(os.path.join(self.tmp_path, self.module_name), ignore_errors=True)
17-
1811
# @unittest.skip("skip")
1912
# @unittest.expectedFailure
2013
deftest_ptrack_recovery(self):

‎tests/ptrack_recovery.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
importos
22
importunittest
33
fromsysimportexit
4-
fromtestgresimportclean_all,stop_all
54
from .helpers.ptrack_helpersimportProbackupTest,idx_ptrack
6-
importshutil
75

86

97
classSimpleTest(ProbackupTest,unittest.TestCase):

‎tests/ptrack_vacuum.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
importos
22
importunittest
3-
fromtestgresimportstop_all,clean_all
43
from .helpers.ptrack_helpersimportProbackupTest,idx_ptrack
5-
importshutil
64

75

86
classSimpleTest(ProbackupTest,unittest.TestCase):
97
def__init__(self,*args,**kwargs):
108
super(SimpleTest,self).__init__(*args,**kwargs)
119
self.module_name='ptrack_vacuum'
1210

13-
# @classmethod
14-
# def tearDownClass(cls):
15-
# clean_all()
16-
# shutil.rmtree(os.path.join(self.tmp_path, self.module_name), ignore_errors=True)
17-
1811
# @unittest.skip("skip")
1912
# @unittest.expectedFailure
2013
deftest_ptrack_vacuum(self):

‎tests/ptrack_vacuum_bits_frozen.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
importos
22
importunittest
3-
fromtestgresimportstop_all,clean_all
43
from .helpers.ptrack_helpersimportProbackupTest,idx_ptrack
5-
importshutil
64

75

86
classSimpleTest(ProbackupTest,unittest.TestCase):
97
def__init__(self,*args,**kwargs):
108
super(SimpleTest,self).__init__(*args,**kwargs)
119
self.module_name='ptrack_vacuum_bits_frozen'
1210

13-
# @classmethod
14-
# def tearDownClass(cls):
15-
# clean_all()
16-
# shutil.rmtree(os.path.join(self.tmp_path, self.module_name), ignore_errors=True)
17-
1811
# @unittest.skip("skip")
1912
# @unittest.expectedFailure
2013
deftest_ptrack_vacuum_bits_frozen(self):

‎tests/ptrack_vacuum_bits_visibility.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
importos
22
importunittest
3-
fromtestgresimportstop_all,clean_all
43
from .helpers.ptrack_helpersimportProbackupTest,idx_ptrack
5-
importshutil
64

75

86
classSimpleTest(ProbackupTest,unittest.TestCase):
97
def__init__(self,*args,**kwargs):
108
super(SimpleTest,self).__init__(*args,**kwargs)
119
self.module_name='ptrack_vacuum_bits_visibility'
1210

13-
# @classmethod
14-
# def tearDownClass(cls):
15-
# clean_all()
16-
# shutil.rmtree(os.path.join(self.tmp_path, self.module_name), ignore_errors=True)
17-
1811
# @unittest.skip("skip")
1912
# @unittest.expectedFailure
2013
deftest_ptrack_vacuum_bits_visibility(self):

‎tests/ptrack_vacuum_full.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
importos
22
importunittest
3-
fromtestgresimportstop_all,clean_all
43
from .helpers.ptrack_helpersimportProbackupTest,idx_ptrack
5-
importshutil
64

75

86
classSimpleTest(ProbackupTest,unittest.TestCase):

‎tests/ptrack_vacuum_truncate.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
importos
22
importunittest
3-
fromtestgresimportstop_all,clean_all
43
from .helpers.ptrack_helpersimportProbackupTest,idx_ptrack
5-
importshutil
64

75

86
classSimpleTest(ProbackupTest,unittest.TestCase):
97
def__init__(self,*args,**kwargs):
108
super(SimpleTest,self).__init__(*args,**kwargs)
119
self.module_name='ptrack_vacuum_truncate'
1210

13-
# @classmethod
14-
# def tearDownClass(self):
15-
# clean_all()
16-
# shutil.rmtree(os.path.join(self.tmp_path, self.module_name), ignore_errors=True)
17-
1811
# @unittest.skip("skip")
1912
# @unittest.expectedFailure
2013
deftest_ptrack_vacuum_truncate(self):

‎tests/replica.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
importunittest
21
importos
2+
importunittest
33
from .helpers.ptrack_helpersimportProbackupTest,ProbackupException,idx_ptrack
44
fromdatetimeimportdatetime,timedelta
5-
fromtestgresimportstop_all,clean_all
65
importsubprocess
7-
fromsysimportexit
8-
importtime
9-
importshutil
106

117

128
classReplicaTest(ProbackupTest,unittest.TestCase):
@@ -15,11 +11,6 @@ def __init__(self, *args, **kwargs):
1511
super(ReplicaTest,self).__init__(*args,**kwargs)
1612
self.module_name='replica'
1713

18-
# @classmethod
19-
# def tearDownClass(cls):
20-
# clean_all()
21-
# shutil.rmtree(os.path.join(self.tmp_path, self.module_name), ignore_errors=True)
22-
2314
# @unittest.skip("skip")
2415
# @unittest.expectedFailure
2516
deftest_replica_stream_full_backup(self):

‎tests/restore_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
importunittest
21
importos
2+
importunittest
33
from .helpers.ptrack_helpersimportProbackupTest,ProbackupException
4-
fromtestgresimportstop_all,clean_all
54
importsubprocess
65
fromdatetimeimportdatetime
7-
fromsysimportexit
86

97

108
classRestoreTest(ProbackupTest,unittest.TestCase):

‎tests/retention_test.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
importunittest
21
importos
2+
importunittest
33
fromdatetimeimportdatetime,timedelta
4-
fromosimportpath,listdir
54
from .helpers.ptrack_helpersimportProbackupTest
6-
fromtestgresimportstop_all,clean_all
7-
importshutil
85

96

107
classRetentionTest(ProbackupTest,unittest.TestCase):
@@ -52,7 +49,7 @@ def test_retention_redundancy_1(self):
5249
min_wal=line[31:-1]
5350
elifline.startswith("INFO: removed max WAL segment"):
5451
max_wal=line[31:-1]
55-
forwal_nameinlistdir(os.path.join(backup_dir,'wal','node')):
52+
forwal_nameinos.listdir(os.path.join(backup_dir,'wal','node')):
5653
ifnotwal_name.endswith(".backup"):
5754
#wal_name_b = wal_name.encode('ascii')
5855
self.assertEqual(wal_name[8:]>min_wal[8:],True)
@@ -85,12 +82,12 @@ def test_retention_window_2(self):
8582
# Make backup to be keeped
8683
self.backup_node(backup_dir,'node',node)
8784

88-
backups=path.join(backup_dir,'backups','node')
85+
backups=os.path.join(backup_dir,'backups','node')
8986
days_delta=5
90-
forbackupinlistdir(backups):
87+
forbackupinos.listdir(backups):
9188
ifbackup=='pg_probackup.conf':
9289
continue
93-
withopen(path.join(backups,backup,"backup.control"),"a")asconf:
90+
withopen(os.path.join(backups,backup,"backup.control"),"a")asconf:
9491
conf.write("recovery_time='{:%Y-%m-%d %H:%M:%S}'\n".format(
9592
datetime.now()-timedelta(days=days_delta)))
9693
days_delta-=1

‎tests/show_test.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
importunittest
21
importos
3-
fromosimportpath
2+
importunittest
43
from .helpers.ptrack_helpersimportProbackupTest
5-
fromtestgresimportstop_all,clean_all
6-
importshutil
74

85

96
classOptionTest(ProbackupTest,unittest.TestCase):
@@ -55,7 +52,7 @@ def test_corrupt_2(self):
5552
backup_id=self.backup_node(backup_dir,'node',node)
5653

5754
# delete file which belong to backup
58-
file=path.join(backup_dir,"backups","node",backup_id,"database","postgresql.conf")
55+
file=os.path.join(backup_dir,"backups","node",backup_id,"database","postgresql.conf")
5956
os.remove(file)
6057

6158
self.validate_pb(backup_dir,'node',backup_id)

‎tests/validate_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
importunittest
21
importos
2+
importunittest
33
from .helpers.ptrack_helpersimportProbackupTest,ProbackupException
44
fromdatetimeimportdatetime,timedelta
5-
fromtestgresimportstop_all,clean_all
65
importsubprocess
7-
fromsysimportexit
86

97

108
classValidateTest(ProbackupTest,unittest.TestCase):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp