mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 04:10:49 +08:00
fixed tests
This commit is contained in:
@ -45,7 +45,7 @@ def convert_to_markdown(output_data: dict) -> str:
|
||||
}
|
||||
|
||||
for key, value in output_data.items():
|
||||
if value is None:
|
||||
if value is None or value == '' or value == {}:
|
||||
continue
|
||||
if isinstance(value, dict):
|
||||
markdown_text += f"## {key}\n\n"
|
||||
|
@ -67,33 +67,11 @@ class TestConvertToMarkdown:
|
||||
]
|
||||
}
|
||||
expected_output = """\
|
||||
- 🎯 **Main theme:** Test
|
||||
- 📌 **Type of PR:** Test type
|
||||
- 🧪 **Relevant tests added:** no
|
||||
- ✨ **Focused PR:** Yes
|
||||
- 💡 **General PR suggestions:** general suggestion...
|
||||
|
||||
- 🤖 **Code feedback:**
|
||||
|
||||
- **Code example:**
|
||||
- **Before:**
|
||||
```
|
||||
Code before
|
||||
```
|
||||
- **After:**
|
||||
```
|
||||
Code after
|
||||
```
|
||||
|
||||
- **Code example:**
|
||||
- **Before:**
|
||||
```
|
||||
Code before 2
|
||||
```
|
||||
- **After:**
|
||||
```
|
||||
Code after 2
|
||||
```
|
||||
- 🎯 **Main theme:** Test\n\
|
||||
- 📌 **Type of PR:** Test type\n\
|
||||
- 🧪 **Relevant tests added:** no\n\
|
||||
- ✨ **Focused PR:** Yes\n\
|
||||
- **General PR suggestions:** general suggestion...\n\n\n- **<details><summary> 🤖 Code feedback:**</summary>\n\n - **Code example:**\n - **Before:**\n ```\n Code before\n ```\n - **After:**\n ```\n Code after\n ```\n\n - **Code example:**\n - **Before:**\n ```\n Code before 2\n ```\n - **After:**\n ```\n Code after 2\n ```\n\n</details>\
|
||||
"""
|
||||
assert convert_to_markdown(input_data).strip() == expected_output.strip()
|
||||
|
||||
@ -113,5 +91,5 @@ class TestConvertToMarkdown:
|
||||
'General PR suggestions': {},
|
||||
'Code suggestions': {}
|
||||
}
|
||||
expected_output = ""
|
||||
expected_output = ''
|
||||
assert convert_to_markdown(input_data).strip() == expected_output.strip()
|
||||
|
Reference in New Issue
Block a user