async def test_get_config(): _cleanup() async with aiohttp.ClientSession() as session: await api.install_all_tentacles(_tentacles_local_path(), aiohttp_session=session) from tentacles.Evaluator.RealTime import InstantFluctuationsEvaluator setup_config = configuration.TentaclesSetupConfiguration() assert get_config(setup_config, InstantFluctuationsEvaluator) == { "price_difference_threshold_percent": 1, "volume_difference_threshold_percent": 400 } from tentacles.Services import RedditService assert get_config(setup_config, RedditService) == {} _cleanup()
async def test_update_config(): async with aiohttp.ClientSession() as session: await install_all_tentacles(_tentacles_local_path(), aiohttp_session=session) from tentacles.Evaluator.RealTime import InstantFluctuationsEvaluator setup_config = configuration.TentaclesSetupConfiguration() config_update = {"price_difference_threshold_percent": 2, "plop": 42} update_config(setup_config, InstantFluctuationsEvaluator, config_update) assert get_config(setup_config, InstantFluctuationsEvaluator) == { "price_difference_threshold_percent": 2, "volume_difference_threshold_percent": 400, "plop": 42 } _cleanup()