18 lines
495 B
Python
18 lines
495 B
Python
|
|
import sys
|
||
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
sys.path.append(str(Path(__file__).resolve().parents[1]))
|
||
|
|
|
||
|
|
from parsers.orderbook_parser import OrderbookParser
|
||
|
|
|
||
|
|
|
||
|
|
def test_parse_side_malformed_text_does_not_raise():
|
||
|
|
parser = OrderbookParser(debug=False)
|
||
|
|
side = {}
|
||
|
|
# Malformed text that literal_eval cannot parse
|
||
|
|
bad_text = "[[100.0, 'missing tuple closing'"
|
||
|
|
# Should not raise; should simply log an error and leave side empty
|
||
|
|
parser.parse_side(bad_text, side)
|
||
|
|
assert side == {}
|
||
|
|
|