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

Commit04e74ab

Browse files
committed
allow single arg in append_conf()
1 parentf800bfc commit04e74ab

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

‎testgres/node.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -384,21 +384,22 @@ def get_auth_method(t):
384384

385385
returnself
386386

387-
defappend_conf(self,filename,string):
387+
@method_decorator(positional_args_hack(['filename','line']))
388+
defappend_conf(self,line,filename=PG_CONF_FILE):
388389
"""
389-
Append line to a config file (i.e. postgresql.conf).
390+
Append line to a config file.
390391
391392
Args:
392-
filename: name of the config file.
393-
string: string to be appended to config.
393+
line: string to be appended to config.
394+
filename: config file (postgresql.conf by default).
394395
395396
Returns:
396397
This instance of PostgresNode.
397398
"""
398399

399400
config_name=os.path.join(self.data_dir,filename)
400-
withio.open(config_name,"a")asconf:
401-
conf.write(u"".join([string,'\n']))
401+
withio.open(config_name,'a')asconf:
402+
conf.write(u''.join([line,'\n']))
402403

403404
returnself
404405

‎tests/test_simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def test_reload(self):
171171

172172
# change client_min_messages and save old value
173173
cmm_old=node.execute('show client_min_messages')
174-
node.append_conf('postgresql.conf','client_min_messages = DEBUG1')
174+
node.append_conf('client_min_messages = DEBUG1')
175175

176176
# reload config
177177
node.reload()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp