| 46 | |
| 47 | @when("we launch dbcli using {arg}") |
| 48 | def step_run_cli_using_arg(context, arg): |
| 49 | prompt_check = False |
| 50 | currentdb = None |
| 51 | if arg == "--username": |
| 52 | arg = "--username={}".format(context.conf["user"]) |
| 53 | if arg == "--user": |
| 54 | arg = "--user={}".format(context.conf["user"]) |
| 55 | if arg == "--port": |
| 56 | arg = "--port={}".format(context.conf["port"]) |
| 57 | if arg == "--password": |
| 58 | arg = "--password" |
| 59 | prompt_check = False |
| 60 | # This uses the mock_pg_service.conf file in fixtures folder. |
| 61 | if arg == "dsn_password": |
| 62 | arg = "service=mock_postgres --password" |
| 63 | prompt_check = False |
| 64 | currentdb = "postgres" |
| 65 | wrappers.run_cli(context, run_args=[arg], prompt_check=prompt_check, currentdb=currentdb) |
| 66 | |
| 67 | |
| 68 | @when("we wait for prompt") |