code: def test_fill(
      mock_order_listener_class, mock_trade_class, mock_exchange_class
  ):
      exchange = mock_exchange_class.return_value
      exchange.options = ExchangeOptions()
      exchange.id = "fake_exchange_id"
      exchange.name = "bitfinex"
      exchange.clock = mock.Mock()
      exchange.clock.step = 0
  
      wallets = [
          Wallet(exchange, 10000 * USD),
          Wallet(exchange, 0 * BTC),
      ]
      portfolio = Portfolio(USD, wallets)
  
      order = Order(
          step=0,
          exchange_pair=ExchangePair(exchange, USD / BTC),
          side=TradeSide.BUY,
          trade_type=TradeType.MARKET,
          quantity=5200.00 * USD,
          portfolio=portfolio,
          price=Decimal(7000.00),
      )
  
      listener = mock_order_listener_class.return_value
      listener.on_fill = mock.Mock(return_value=None)
      order.attach(listener)
  
      order.execute()
  
      trade = mock_trade_class.return_value
      trade.size = Decimal(3997.00)
      trade.quantity = 3997.00 * USD
      trade.commission = 3.00 * USD
  
      assert order.status == OrderStatus.OPEN
      order.fill(trade)
      assert order.status == OrderStatus.PARTIALLY_FILLED
  
      assert order.remaining == 1200.00
  
      listener.on_fill.assert_called_once_with(order, trade)
  
imports: import re
  import unittest.mock
  from decimal import Decimal
  from tensortrade.oms.instruments import *
  from tensortrade.oms.orders import Order, OrderStatus, OrderSpec, TradeSide, TradeType
  from tensortrade.oms.orders.criteria import Stop
  from tensortrade.oms.exchanges import ExchangeOptions
  from tensortrade.oms.wallets import Wallet, Portfolio
label_desc: Use image node_id 9 for calling a global function with example usage: test_fill(mock_order_listener_class, mock_trade_class, mock_exchange_class) without return types