Merge pull request #1061 from iorisa/feature/repo_to_markdown

feat: repo to markdown
This commit is contained in:
Alexander Wu 2024-03-21 22:44:58 +08:00 committed by GitHub
commit fdf53ac555
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 124 additions and 0 deletions

View file

@ -0,0 +1,25 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from pathlib import Path
import pytest
from metagpt.utils.repo_to_markdown import repo_to_markdown
@pytest.mark.parametrize(
["repo_path", "output"],
[(Path(__file__).parent.parent, Path(__file__).parent.parent.parent / f"workspace/unittest/{uuid.uuid4().hex}.md")],
)
@pytest.mark.asyncio
async def test_repo_to_markdown(repo_path: Path, output: Path):
markdown = await repo_to_markdown(repo_path=repo_path, output=output)
assert output.exists()
assert markdown
output.unlink(missing_ok=True)
if __name__ == "__main__":
pytest.main([__file__, "-s"])