TEST - WIP
This commit is contained in:
parent
17e8040712
commit
c717c04bd0
|
|
@ -122,7 +122,11 @@ def execute_psql_command(
|
|||
):
|
||||
"""Execute psql request in postgres container with psql_args on database"""
|
||||
container = get_postgres_container(ctx)
|
||||
logger.warning("DEBUG ========= execute_psql_command")
|
||||
logger.warning("request: ", request)
|
||||
logger.warning("database: ", database)
|
||||
escaped_request = request.replace('"', '\\"')
|
||||
logger.warning("escaped_request: ", escaped_request)
|
||||
command = (
|
||||
"psql"
|
||||
" --username=odoo"
|
||||
|
|
@ -130,6 +134,7 @@ def execute_psql_command(
|
|||
f' --command "{escaped_request}"'
|
||||
f" {' '.join(psql_args)}"
|
||||
)
|
||||
logger.warning("command: ", command)
|
||||
logger.debug(
|
||||
"Executing the following command in postgres container\n"
|
||||
"%s" % (command)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from pytest import raises
|
|||
|
||||
from odoo_openupgrade_wizard.tools.tools_postgres import (
|
||||
ensure_database,
|
||||
execute_psql_command,
|
||||
execute_sql_request,
|
||||
)
|
||||
|
||||
from . import (
|
||||
|
|
@ -38,12 +38,7 @@ def test_cli_psql():
|
|||
" WHERE state ='installed'"
|
||||
" AND name='base';"
|
||||
)
|
||||
output = execute_psql_command(
|
||||
ctx,
|
||||
request,
|
||||
database=db_name,
|
||||
psql_args=("--tuples-only",),
|
||||
)
|
||||
output = execute_sql_request(ctx, request)
|
||||
assert output.strip() == "base"
|
||||
|
||||
# test via cli ok
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user