def test_add_symbol(hass): """Test check for existing symbols.""" coordinator = YahooSymbolUpdateCoordinator([], hass, DEFAULT_SCAN_INTERVAL) with patch(f"{YSUC}.async_request_refresh"): assert coordinator.add_symbol(TEST_SYMBOL) is True assert TEST_SYMBOL in coordinator.get_symbols()
async def test_add_symbol(hass): """Add symbol for load.""" mock_coordinator = YahooSymbolUpdateCoordinator([], hass, DEFAULT_SCAN_INTERVAL) with patch( "homeassistant.helpers.event.async_call_later") as mock_call_later: assert mock_coordinator.add_symbol(TEST_SYMBOL) is True assert TEST_SYMBOL in mock_coordinator.get_symbols() assert len(mock_call_later.mock_calls) == 1