def test_on_validate_price_source_non_external_market_reset(self): pmm_config_map["price_source_exchange"].value = "an_extmkt" pmm_config_map["price_source_market"].value = self.trading_pair pmm_config_map["take_if_crossed"].value = False on_validate_price_source(value="current_market") self.assertIsNone(pmm_config_map["price_source_exchange"].value) self.assertIsNone(pmm_config_map["price_source_market"].value) self.assertIsNone(pmm_config_map["take_if_crossed"].value)
def test_on_validate_price_source_custom_api_set_price_type(self): on_validate_price_source(value="custom_api") self.assertEqual(pmm_config_map["price_type"].value, "custom")
def test_on_validate_price_source_non_custom_api_reset(self): pmm_config_map["price_source_custom_api"].value = "https://someurl.com" on_validate_price_source(value="current_market") self.assertIsNone(pmm_config_map["price_source_custom_api"].value)