Merging upstream version 1.12.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
efb6cb056d
commit
66b78e69ac
17 changed files with 293 additions and 71 deletions
|
@ -23,3 +23,37 @@ def test_log_location_config():
|
|||
content = logfile.read()
|
||||
|
||||
assert len(content) > 100
|
||||
|
||||
|
||||
def test_load_prompt_from_config(iredis_client, clean_redis):
|
||||
config_content = dedent(
|
||||
"""
|
||||
[main]
|
||||
prompt = {host}abc{port}xx{db}
|
||||
"""
|
||||
)
|
||||
with open("/tmp/iredisrc", "w+") as etc_config:
|
||||
etc_config.write(config_content)
|
||||
|
||||
cli = pexpect.spawn("iredis -n 15 --iredisrc /tmp/iredisrc", timeout=1)
|
||||
cli.expect("iredis")
|
||||
cli.expect("127.0.0.1abc6379xx15")
|
||||
cli.close()
|
||||
|
||||
|
||||
def test_prompt_cli_overwrite_config(iredis_client, clean_redis):
|
||||
config_content = dedent(
|
||||
"""
|
||||
[main]
|
||||
prompt = {host}abc{port}xx{db}
|
||||
"""
|
||||
)
|
||||
with open("/tmp/iredisrc", "w+") as etc_config:
|
||||
etc_config.write(config_content)
|
||||
|
||||
cli = pexpect.spawn(
|
||||
"iredis -n 15 --iredisrc /tmp/iredisrc --prompt='{db}-12345'", timeout=1
|
||||
)
|
||||
cli.expect("iredis")
|
||||
cli.expect("15-12345")
|
||||
cli.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue