🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
bugfix: mermaid unittest
voidkingf861d4be1f91
diff --git a/tests/metagpt/utils/test_mermaid.py b/tests/metagpt/utils/test_mermaid.pyindex 912453aaf..b7b97a3f1 100644--- a/tests/metagpt/utils/test_mermaid.py+++ b/tests/metagpt/utils/test_mermaid.py@@ -10,29 +10,31 @@ import pytestfrom metagpt.config import CONFIGfrom metagpt.utils.common import check_cmd_exists-from metagpt.utils.mermaid import MMC1, MMC2, mermaid_to_file+from metagpt.utils.mermaid import MMC1, mermaid_to_file@pytest.mark.asyncio[email protected]("engine", ["nodejs", "playwright", "pyppeteer", "ink"])[email protected]("engine", ["nodejs", "ink"]) # TODO: playwright and pyppeteerasync def test_mermaid(engine):- # Prerequisites- # npm install -g @mermaid-js/mermaid-cli+ # nodejs prerequisites: npm install -g @mermaid-js/mermaid-cli+ # ink prerequisites: connected to internet+ # playwright prerequisites: playwright install --with-deps chromiumassert check_cmd_exists("npm") == 0assert CONFIG.PYPPETEER_EXECUTABLE_PATHCONFIG.mermaid_engine = enginesave_to = CONFIG.git_repo.workdir / f"{CONFIG.mermaid_engine}/1"await mermaid_to_file(MMC1, save_to)- for ext in [".pdf", ".svg", ".png"]:- assert save_to.with_suffix(ext).exists()- save_to.with_suffix(ext).unlink(missing_ok=True)-- save_to = CONFIG.git_repo.workdir / f"{CONFIG.mermaid_engine}/2"- await mermaid_to_file(MMC2, save_to)- for ext in [".pdf", ".svg", ".png"]:- assert save_to.with_suffix(ext).exists()- save_to.with_suffix(ext).unlink(missing_ok=True)++ # ink does not support pdf+ if engine == "ink":+ for ext in [".svg", ".png"]:+ assert save_to.with_suffix(ext).exists()+ save_to.with_suffix(ext).unlink(missing_ok=True)+ else:+ for ext in [".pdf", ".svg", ".png"]:+ assert save_to.with_suffix(ext).exists()+ save_to.with_suffix(ext).unlink(missing_ok=True)if __name__ == "__main__":