Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_assign(case, expected):
assert _.assign(*case) == expected
:type balance_item: dict
"""
btc_price = 1
is_tracked = False
if balance_item["Currency"] != "BTC":
coin_pair = "BTC-" + balance_item["Currency"]
is_tracked = coin_pair in self.Database.trades["trackedCoinPairs"]
btc_price = self.get_current_price(coin_pair, "bid")
try:
btc_value = round(btc_price * balance_item["Balance"], 8)
except TypeError as exception:
logger.exception(exception)
btc_value = 0
return py_.assign(
py_.pick(balance_item, "Currency", "Balance"),
{"BtcValue": btc_value, "IsTracked": is_tracked}
)
def build_attrs(name, attrs):
return pydash.assign(dict(long_name=name,
coverage_content_type='modelResult'), # defaults
attrs, # Defined by plugin
self.var_attributes.get(name, {})) # From config, highest priority
def build_attrs(name, attrs):
return pydash.assign(dict(long_name=name,
coverage_content_type='modelResult'), # defaults
attrs, # Defined by plugin
self.var_attributes.get(name, {})) # From config, highest priority