fixed tests

This commit is contained in:
mrT23
2023-08-22 20:21:52 +03:00
parent 04be1573d5
commit 412c86593d
2 changed files with 7 additions and 29 deletions

View File

@ -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"

View File

@ -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()