Skip to content

Commit

Permalink
SE-702: Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cscialino committed Jan 11, 2022
1 parent e82cbc1 commit 48e32c2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_differing_quote_and_transaction_instrument_ids(self) -> None:

# Upsert instruments with ISINs to update the instrument identifiers
response = self.instruments_api.upsert_instruments(update_instrument_request)
assert len(response.failed) == 0
self.assertEqual(len(response.failed), 0)

# Create valuation request
valuation_request = self.create_valuation_request(
Expand Down
15 changes: 8 additions & 7 deletions sdk/tests/utilities/base_valuation_tests_setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import lusid
import lusid.models as models
import pytz
from datetime import datetime
import uuid
import unittest
import pytz
from datetime import datetime

import lusid
import lusid.models as models

from utilities import TestDataUtilities, PortfolioLoader, InstrumentLoader
from utilities import TestDataUtilities, PortfolioLoader, InstrumentLoader, IdGenerator

class BaseValuationUtilities(unittest.TestCase):

Expand Down Expand Up @@ -52,8 +53,8 @@ def setUpClass(cls):
cls.instrument_ids = instrument_loader.load_instruments()

# Setup scopes for recipe tests
cls.recipe_scope = "TestIdentifiers"
cls.recipe_code = "SimpleQuotes"
cls.recipe_scope = "SampleRecipes"
cls.recipe_code = "SampleRecipeQuotes"

# Set market data scope to be used with quotes and recipes
cls.market_data_provider = "Lusid"
Expand Down
9 changes: 2 additions & 7 deletions sdk/tests/utilities/portfolio_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ def __init__(self, transaction_portfolios_api: lusid.TransactionPortfoliosApi, i
self.transaction_portfolios_api = transaction_portfolios_api
self.instruments_api = instruments_api

def load_instruments(self, instruments_api) -> list:

instrument_loader = InstrumentLoader(instruments_api)
return instrument_loader.load_instruments()

def build_transaction_request(self, instrument_id, id_type, units, price, currency, trade_date, transaction_type):
return models.TransactionRequest(transaction_id=str(uuid.uuid4()),
type=transaction_type,
Expand All @@ -35,7 +30,7 @@ def setup_gbp_portfolio(self, portfolio_scope, portfolio_code, effective_date) -
:param datetime effective_date: The portfolio creation date
:return: None
"""
instrument_ids = self.load_instruments(self.instruments_api)
instrument_ids = InstrumentLoader(self.instruments_api).load_instruments()

transactions = [
self.build_transaction_request(
Expand Down Expand Up @@ -81,7 +76,7 @@ def setup_xccy_portfolio(self, portfolio_scope, portfolio_code, effective_date)
:param datetime effective_date: The portfolio creation date
:return: None
"""
instrument_ids = self.load_instruments(self.instruments_api)
instrument_ids = InstrumentLoader(self.instruments_api).load_instruments()

transactions = [
self.build_transaction_request(
Expand Down

0 comments on commit 48e32c2

Please sign in to comment.