Use snapshot assertion for Coinbase diagnostics test (#98906)

This commit is contained in:
Joost Lekkerkerker 2023-08-24 01:23:31 +02:00 committed by GitHub
parent faa4489f4c
commit c39f6b3bea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 77 additions and 50 deletions

View file

@ -1,6 +1,5 @@
"""Constants for testing the Coinbase integration."""
from homeassistant.components.diagnostics import REDACTED
GOOD_CURRENCY = "BTC"
GOOD_CURRENCY_2 = "USD"
@ -36,43 +35,3 @@ MOCK_ACCOUNTS_RESPONSE = [
"type": "fiat",
},
]
MOCK_ACCOUNTS_RESPONSE_REDACTED = [
{
"balance": {"amount": REDACTED, "currency": GOOD_CURRENCY},
"currency": GOOD_CURRENCY,
"id": REDACTED,
"name": "BTC Wallet",
"native_balance": {"amount": REDACTED, "currency": GOOD_CURRENCY_2},
"type": "wallet",
},
{
"balance": {"amount": REDACTED, "currency": GOOD_CURRENCY},
"currency": GOOD_CURRENCY,
"id": REDACTED,
"name": "BTC Vault",
"native_balance": {"amount": REDACTED, "currency": GOOD_CURRENCY_2},
"type": "vault",
},
{
"balance": {"amount": REDACTED, "currency": GOOD_CURRENCY_2},
"currency": "USD",
"id": REDACTED,
"name": "USD Wallet",
"native_balance": {"amount": REDACTED, "currency": GOOD_CURRENCY_2},
"type": "fiat",
},
]
MOCK_ENTRY_REDACTED = {
"version": 1,
"domain": "coinbase",
"title": REDACTED,
"data": {"api_token": REDACTED, "api_key": REDACTED},
"options": {"account_balance_currencies": [], "exchange_rate_currencies": []},
"pref_disable_new_entities": False,
"pref_disable_polling": False,
"source": "user",
"unique_id": None,
"disabled_by": None,
}