[IMP] add test on generate-module-analysis

This commit is contained in:
Sylvain LE GAL 2022-05-06 21:15:25 +02:00
parent c7bf8bffc3
commit ac834c6525
3 changed files with 9 additions and 5 deletions

View File

@ -16,6 +16,7 @@ from odoo_openupgrade_wizard.configuration_version_dependant import (
) )
from odoo_openupgrade_wizard.tools_docker import kill_container, run_container from odoo_openupgrade_wizard.tools_docker import kill_container, run_container
from odoo_openupgrade_wizard.tools_odoo_instance import OdooInstance from odoo_openupgrade_wizard.tools_odoo_instance import OdooInstance
from odoo_openupgrade_wizard.tools_postgres import get_postgres_container
from odoo_openupgrade_wizard.tools_system import get_script_folder from odoo_openupgrade_wizard.tools_system import get_script_folder
@ -148,6 +149,8 @@ def run_odoo(
alternative_xml_rpc_port: int = False, alternative_xml_rpc_port: int = False,
links: dict = {}, links: dict = {},
): ):
# Ensure that Postgres container exist
get_postgres_container(ctx)
logger.info( logger.info(
"Launching Odoo Container (Release {release}) for {db_text}" "Launching Odoo Container (Release {release}) for {db_text}"
" in {action} mode. Demo Data is {demo_text}" " in {action} mode. Demo Data is {demo_text}"

View File

@ -40,7 +40,8 @@ def build_ctx_from_config_file(env_folder_path) -> dict:
file.close() file.close()
ctx.obj["env_folder_path"] = env_folder_path ctx.obj["env_folder_path"] = env_folder_path
ctx.obj["src_folder_path"] = env_folder_path / Path("src")
ctx.obj["postgres_folder_path"] = env_folder_path / Path( ctx.obj["postgres_folder_path"] = env_folder_path / Path(
"./postgres_data/data" "postgres_data/data"
) )
return ctx return ctx

View File

@ -16,11 +16,11 @@ def test_cli_generate_module_analysis():
"/base/14.0.1.3/upgrade_general_log.txt" "/base/14.0.1.3/upgrade_general_log.txt"
) )
# This file should exist
assert analysis_file_path.exists()
# We remove this file and run the analysis # We remove this file and run the analysis
try:
analysis_file_path.unlink() analysis_file_path.unlink()
except FileNotFoundError:
pass
analysis_file_path analysis_file_path
cli_runner_invoke( cli_runner_invoke(