diff --git a/network-poc/tests/model-benchmark.mjs b/network-poc/tests/model-benchmark.mjs index 8205a03..8095898 100644 --- a/network-poc/tests/model-benchmark.mjs +++ b/network-poc/tests/model-benchmark.mjs @@ -338,6 +338,16 @@ async function runPipeline(model, scenario) { result.validationIssues = issues.length; result.fixRounds = fixRound; + // Korjaa pyproject.toml jos malli generoi Poetry-muodon + if (files['pyproject.toml'] && !files['pyproject.toml'].includes('[project]')) { + const goldenPyproject = join(GOLDEN_DIR, 'pyproject.toml'); + if (existsSync(goldenPyproject)) { + const nameMatch = files['pyproject.toml'].match(/name\s*=\s*"([^"]+)"/); + const name = nameMatch ? nameMatch[1] : 'generated-app'; + files['pyproject.toml'] = readFileSync(goldenPyproject, 'utf-8').replace(/name = "[^"]+"/, `name = "${name}"`); + } + } + // Kirjoita tiedostot levylle for (const [fn, content] of Object.entries(files)) writeFileSync(`${dir}/${fn}`, content);