def test_get_audusd_when_loaded_returns_expected_instrument(self):
        # Arrange
        mock_client = MagicMock()

        with open(TEST_PATH + "instruments.json") as response:
            instruments = json.load(response)

        mock_client.request.return_value = instruments

        provider = OandaInstrumentProvider(
            client=mock_client, account_id="001", load_all=True
        )

        instrument_id = InstrumentId(Symbol("AUD/USD"), Venue("OANDA"))

        # Act
        instrument = provider.find(instrument_id)

        # Assert
        self.assertEqual(Instrument, type(instrument))
        self.assertEqual(AssetClass.FX, instrument.asset_class)
        self.assertEqual(AssetType.SPOT, instrument.asset_type)
        self.assertEqual(AUD, instrument.base_currency)
        self.assertEqual(USD, instrument.quote_currency)
        self.assertEqual(USD, instrument.settlement_currency)
    def test_get_audusd_when_not_loaded_returns_none(self):
        # Arrange
        mock_client = MagicMock()

        with open(TEST_PATH + "instruments.json") as response:
            instruments = json.load(response)

        mock_client.request.return_value = instruments

        provider = OandaInstrumentProvider(client=mock_client, account_id="001")

        instrument_id = InstrumentId(Symbol("AUD/USD"), Venue("OANDA"))

        # Act
        instrument = provider.find(instrument_id)

        # Assert
        self.assertIsNone(instrument)