code: def test_convert(mock_exchange_pair):
      exchange_pair = mock_exchange_pair.return_value
      exchange_pair.pair = USD / BTC
      exchange_pair.price = 9000
  
      # Test converts to Quote
      quantity = Quantity(USD, 1000)
      converted = quantity.convert(exchange_pair)
  
      assert float(converted.size) == 1000 / 9000
      assert converted.instrument == BTC
  
      # Test converts to Quote
      quantity = Quantity(BTC, 1.6)
      converted = quantity.convert(exchange_pair)
  
      assert float(converted.size) == 1.6 * 9000
      assert converted.instrument == USD
  
imports: import pytest
  import unittest.mock
  from tensortrade.oms.instruments import *
  from tensortrade.core.exceptions import *
label_desc: Use image node_id 25 for calling a global function with example usage: test_convert(mock_exchange_pair) without return types