41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
from pathlib import Path
|
|
|
|
from odoo_openupgrade_wizard.tools_odoo import get_odoo_env_path
|
|
|
|
from . import build_ctx_from_config_file, cli_runner_invoke
|
|
|
|
|
|
def test_cli_generate_module_analysis():
|
|
# TODO, fixme, this test is not working for the time being
|
|
return
|
|
output_folder_path = Path("./tests/output").absolute()
|
|
db_name = "database_test_cli_cli_generate_module_analysis"
|
|
|
|
ctx = build_ctx_from_config_file(output_folder_path)
|
|
# identify main analysis file of openupgrade
|
|
analysis_file_path = get_odoo_env_path(ctx, {"release": 14.0}) / Path(
|
|
"src/openupgrade/openupgrade_scripts/scripts"
|
|
"/base/14.0.1.3/upgrade_general_log.txt"
|
|
)
|
|
|
|
# We remove this file and run the analysis
|
|
try:
|
|
analysis_file_path.unlink()
|
|
except FileNotFoundError:
|
|
pass
|
|
|
|
analysis_file_path
|
|
cli_runner_invoke(
|
|
[
|
|
"--log-level=DEBUG",
|
|
"--env-folder=%s" % output_folder_path,
|
|
"generate-module-analysis",
|
|
"--step=2",
|
|
"--database=%s" % db_name,
|
|
"--modules=base",
|
|
]
|
|
)
|
|
|
|
# The file should has been recreated by the analysis command
|
|
assert analysis_file_path.exists()
|