Remove YAML import from coinbase (#80084)
This commit is contained in:
parent
a1a0284e81
commit
3eb574edca
7 changed files with 13 additions and 193 deletions
|
@ -6,13 +6,10 @@ from homeassistant.components.coinbase.const import (
|
|||
API_TYPE_VAULT,
|
||||
CONF_CURRENCIES,
|
||||
CONF_EXCHANGE_RATES,
|
||||
CONF_YAML_API_TOKEN,
|
||||
DOMAIN,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from .common import (
|
||||
init_mock_coinbase,
|
||||
|
@ -28,37 +25,6 @@ from .const import (
|
|||
)
|
||||
|
||||
|
||||
async def test_setup(hass):
|
||||
"""Test setting up from configuration.yaml."""
|
||||
conf = {
|
||||
DOMAIN: {
|
||||
CONF_API_KEY: "123456",
|
||||
CONF_YAML_API_TOKEN: "AbCDeF",
|
||||
CONF_CURRENCIES: [GOOD_CURRENCY, GOOD_CURRENCY_2],
|
||||
CONF_EXCHANGE_RATES: [GOOD_EXCHANGE_RATE, GOOD_EXCHANGE_RATE_2],
|
||||
}
|
||||
}
|
||||
with patch(
|
||||
"coinbase.wallet.client.Client.get_current_user",
|
||||
return_value=mock_get_current_user(),
|
||||
), patch(
|
||||
"coinbase.wallet.client.Client.get_accounts",
|
||||
new=mocked_get_accounts,
|
||||
), patch(
|
||||
"coinbase.wallet.client.Client.get_exchange_rates",
|
||||
return_value=mock_get_exchange_rates(),
|
||||
):
|
||||
assert await async_setup_component(hass, DOMAIN, conf)
|
||||
entries = hass.config_entries.async_entries(DOMAIN)
|
||||
assert len(entries) == 1
|
||||
assert entries[0].title == "Test User"
|
||||
assert entries[0].source == config_entries.SOURCE_IMPORT
|
||||
assert entries[0].options == {
|
||||
CONF_CURRENCIES: [GOOD_CURRENCY, GOOD_CURRENCY_2],
|
||||
CONF_EXCHANGE_RATES: [GOOD_EXCHANGE_RATE, GOOD_EXCHANGE_RATE_2],
|
||||
}
|
||||
|
||||
|
||||
async def test_unload_entry(hass):
|
||||
"""Test successful unload of entry."""
|
||||
with patch(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue