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

Commit10f43fb

Browse files
committed
fix get_control_data()
1 parentee89512 commit10f43fb

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

‎testgres/testgres.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -628,15 +628,15 @@ def get_control_data(self):
628628
else:
629629
_params= ["-D",self.data_dir]
630630

631-
lines=_execute_utility("pg_controldata",_params,self.utils_logname)
631+
data=_execute_utility("pg_controldata",_params,self.utils_logname)
632632

633-
out_data= {}
633+
out_dict= {}
634634

635-
forlineinlines:
636-
key,value=line.partition(':')[::2]
637-
out_data[key.strip()]=value.strip()
635+
forlineindata.splitlines():
636+
key,_,value=line.partition(':')
637+
out_dict[key.strip()]=value.strip()
638638

639-
returnout_data
639+
returnout_dict
640640

641641
defstart(self,params=[]):
642642
"""

‎tests/test_simple.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ def test_control_data(self):
155155
try:
156156
node.init()
157157
data=node.get_control_data()
158+
159+
# check returned dict
158160
self.assertIsNotNone(data)
161+
self.assertTrue(any('pg_control'insforsindata.keys()))
162+
159163
exceptExecUtilExceptionase:
160164
print(e.message)
161165
got_exception=True

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp