mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-07-05 17:01:16 -03:00
chore(tests): update bash code block tests to match preserved-bash behavior
Commit 9a0d866b changed _strip_fenced_code_blocks to preserve bash/shell
code blocks (they carry CLI setup and trigger-word metadata signal).
Update the two affected tests to expect bash content in the output
instead of asserting it is stripped.
- Rename test_bash_code_block_stripped → test_bash_code_block_preserved
- Update assertions: expect 'pip install' in result
This commit is contained in:
@@ -749,7 +749,9 @@ Some text.
|
|||||||
assert "## Usage" in result
|
assert "## Usage" in result
|
||||||
assert "## Description" in result
|
assert "## Description" in result
|
||||||
|
|
||||||
def test_bash_code_block_stripped(self):
|
def test_bash_code_block_preserved(self):
|
||||||
|
"""Bash code blocks are preserved — they contain CLI setup commands
|
||||||
|
and trigger-word install instructions that carry metadata signal."""
|
||||||
md = """## Setup
|
md = """## Setup
|
||||||
```bash
|
```bash
|
||||||
pip install diffusers
|
pip install diffusers
|
||||||
@@ -757,13 +759,16 @@ huggingface-cli download repo
|
|||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
result = self._clean(md)
|
result = self._clean(md)
|
||||||
assert "pip install" not in result
|
assert "pip install" in result
|
||||||
|
assert "huggingface-cli download repo" in result
|
||||||
assert "## Setup" in result
|
assert "## Setup" in result
|
||||||
|
|
||||||
def test_code_block_sections_remain_separated(self):
|
def test_code_block_sections_remain_separated(self):
|
||||||
|
"""Bash code blocks are preserved (they carry metadata signal),
|
||||||
|
and surrounding section headings survive."""
|
||||||
md = "## Install\n```bash\npip install x\n```\n\n## Usage\nSome text."
|
md = "## Install\n```bash\npip install x\n```\n\n## Usage\nSome text."
|
||||||
result = self._clean(md)
|
result = self._clean(md)
|
||||||
assert "pip install" not in result
|
assert "pip install x" in result
|
||||||
assert "## Install" in result
|
assert "## Install" in result
|
||||||
assert "## Usage" in result
|
assert "## Usage" in result
|
||||||
assert "Some text." in result
|
assert "Some text." in result
|
||||||
|
|||||||
Reference in New Issue
Block a user