mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
ruff fix
This commit is contained in:
parent
e6e72c6e23
commit
6755de0ee8
13 changed files with 290 additions and 573 deletions
|
|
@ -5,17 +5,16 @@
|
|||
@Author : femto Zheng
|
||||
@File : test_custom_decoder.py
|
||||
"""
|
||||
import pytest
|
||||
|
||||
import json
|
||||
|
||||
from metagpt.utils.custom_decoder import CustomDecoder
|
||||
|
||||
|
||||
def test_parse_single_quote():
|
||||
# Create a custom JSON decoder
|
||||
decoder = CustomDecoder(strict=False)
|
||||
# Your provided input with single-quoted strings and line breaks
|
||||
input_data = '''{'a"
|
||||
input_data = """{'a"
|
||||
b':'"title": "Reach and engagement of campaigns",
|
||||
"x-axis": "Low Reach --> High Reach",
|
||||
"y-axis": "Low Engagement --> High Engagement",
|
||||
|
|
@ -32,9 +31,8 @@ def test_parse_single_quote():
|
|||
"Our Target Product": [0.5, 0.6]
|
||||
'
|
||||
}
|
||||
'''
|
||||
"""
|
||||
# Parse the JSON using the custom decoder
|
||||
|
||||
parsed_data = decoder.decode(input_data)
|
||||
assert 'a"\n b' in parsed_data
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue