code: def test_init(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
  
      side = TradeSide.BUY
      trade_type = TradeType.MARKET
  
      # Create order specification without criteria
      order_spec = OrderSpec(
          side=side,
          trade_type=trade_type,
          exchange_pair=ExchangePair(exchange, USD / BTC),
      )
  
      assert order_spec.id
      assert order_spec.side == side
      assert order_spec.type == trade_type
      assert order_spec.exchange_pair == ExchangePair(
          exchange, USD / BTC
      )
      assert not order_spec.criteria
  
      # Create order specification with criteria
      order_spec = OrderSpec(
          side=side,
          trade_type=trade_type,
          exchange_pair=ExchangePair(exchange, USD / BTC),
          criteria=lambda order, exchange: True,
      )
  
      assert order_spec.id
      assert order_spec.side == side
      assert order_spec.type == trade_type
      assert order_spec.exchange_pair == ExchangePair(
          exchange, USD / BTC
      )
      assert order_spec.criteria
  
file_path: tensortrade/tests/tensortrade/unit/oms/orders/test_order_spec.py
imports: import re
  import unittest.mock
  from decimal import Decimal
  from tensortrade.oms.orders import OrderSpec, TradeSide, TradeType
  from tensortrade.oms.exchanges import ExchangeOptions
  from tensortrade.oms.instruments import USD, BTC, ExchangePair
  from tensortrade.oms.wallets import Portfolio, Wallet
label_desc: Use image node_id 1 for calling a global function with example usage: test_init(mock_exchange_class) without return types