def test__fetch_wallet_config_emptyDict_returnsDefaultSettings(): wallet_config = {} config = Config() config._fetch_wallet_config(wallet_config) assert (config.start_cash == 0 and config.return_method == "total_value" and config.benchmark == "" and config.risk_free_return == 0.0 and config.fee_min == 0.0 and config.fee_rate == 0.0 and config.fee_added == 0.0 and config.fee_max == 0.0)
def test__fetch_wallet_config_validData_fetchesValidVariables(): wallet_config = { "start_cash": 1, "return_method": "sharpe", "benchmark": "wig", "risk_free_return": 1.0, "fees": { "min": 1.0, "rate": 1.0, "added": 1.0, "max": 1.0 }, } config = Config() config._fetch_wallet_config(wallet_config) assert (config.start_cash == 1 and config.return_method == "sharpe" and config.benchmark == "wig" and config.risk_free_return == 1.0 and config.fee_min == 1.0 and config.fee_rate == 1.0 and config.fee_added == 1.0 and config.fee_max == 1.0)