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