code: def test_execute(mock_order_listener_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_execute = mock.Mock(return_value=None)
      order.attach(listener)
  
      assert order.status == OrderStatus.PENDING
      order.execute()
      assert order.status == OrderStatus.OPEN
  
      wallet_usd = portfolio.get_wallet(exchange.id, USD)
      wallet_btc = portfolio.get_wallet(exchange.id, BTC)
  
      assert wallet_usd.balance == 4800 * USD
      assert wallet_usd.locked_balance == 5200 * USD
      assert order.path_id in wallet_usd.locked.keys()
      assert wallet_btc.balance == 0 * BTC
  
      listener.on_execute.assert_called_once_with(order)
  
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 8 for calling a global function with example usage: test_execute(mock_order_listener_class, mock_exchange_class) without return types